Skip to content

Commit

Permalink
Merge branch 'JasperFx:main' into gcp-pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-zahiri authored Nov 5, 2024
2 parents ba5c309 + 88ca211 commit f34c0fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const config: UserConfig<DefaultTheme.Config> = {
{text: 'Conventional Routing', link:'/guide/messaging/transports/gcp-pubsub/conventional-routing'},
{text: 'Interoperability', link:'/guide/messaging/transports/gcp-pubsub/interoperability'}
]},
{text: 'Apache Pulsar', link: '/guide/messaging/transports/pulsar'},
{text: 'Sql Server', link: '/guide/messaging/transports/sqlserver'},
{text: 'PostgreSQL', link: '/guide/messaging/transports/postgresql'},
{text: 'MQTT', link: '/guide/messaging/transports/mqtt'},
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/http/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static ArithmeticResults PostJson(Question question)
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Http/WolverineWebApi/TestEndpoints.cs#L83-L95' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_simple_wolverine_http_endpoint' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

In the method signature above, `Question` is the "request" type (the payload sent from the client to the server) and `Answer` is the "resource" type (what is being returned to the client).
In the method signature above, `Question` is the "request" type (the payload sent from the client to the server) and `ArithmeticResults` is the "resource" type (what is being returned to the client).
If instead that method were asynchronous like this:

<!-- snippet: sample_simple_wolverine_http_endpoint_async -->
Expand All @@ -39,8 +39,8 @@ public static Task<ArithmeticResults> PostJsonAsync(Question question)
<sup><a href='https://github.com/JasperFx/wolverine/blob/main/src/Http/WolverineWebApi/TestEndpoints.cs#L97-L111' title='Snippet source file'>snippet source</a> | <a href='#snippet-sample_simple_wolverine_http_endpoint_async' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

The resource type is still `Answer`. Likewise, if an endpoint returns `ValueTask<Answer>`, the resource type
is also `Answer`, and Wolverine will worry about the asynchronous (or `return Task.CompletedTask;`) mechanisms
The resource type is still `ArithmeticResults`. Likewise, if an endpoint returns `ValueTask<ArithmeticResults>`, the resource type
is also `ArithmeticResults`, and Wolverine will worry about the asynchronous (or `return Task.CompletedTask;`) mechanisms
for you in the generated code.

## Legal Endpoint Signatures
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/http/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The code up above is very close to a functional equivalent to our early Minimal
couple differences:

1. In this case the HTTP endpoint will return a status code of `200` instead of the slightly more correct `201` that denotes
a creation. **Most of use aren't really going to care, but we'll come back to this a little later**
a creation. **Most of us aren't really going to care, but we'll come back to this a little later**
2. In the call to `MapPostToWolverine()`, Wolverine.HTTP is able to make a couple performance optimizations that completely
eliminates any usage of the application's IoC container at runtime and bypasses some dictionary lookups and object allocation
that would have to occur in the simple "mediator" approach
Expand Down

0 comments on commit f34c0fa

Please sign in to comment.