Skip to content

Commit d06a8d2

Browse files
actions-usermauroservienti
authored andcommitted
MarkdownSnippets documentation changes
1 parent c1ffe94 commit d06a8d2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/scatter-gather.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
1414
{
1515
Gatherers = new List<Gatherer>
1616
{
17-
new(key: "ASamplesSource", destination: "https://a.web.server/api/samples/ASamplesSource"),
18-
new(key: "AnotherSamplesSource", destination: "https://another.web.server/api/samples/AnotherSamplesSource")
17+
new HttpGatherer(key: "ASamplesSource", destinationUrl: "https://a.web.server/api/samples/ASamplesSource"),
18+
new HttpGatherer(key: "AnotherSamplesSource", destinationUrl: "https://another.web.server/api/samples/AnotherSamplesSource")
1919
}
2020
}));
2121
}
2222
```
23-
<sup><a href='/src/Snippets/ScatterGather/Startup.cs#L10-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-scatter-gather-basic-usage' title='Start of snippet'>anchor</a></sup>
23+
<sup><a href='/src/Snippets/ScatterGather/Startup.cs#L11-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-scatter-gather-basic-usage' title='Start of snippet'>anchor</a></sup>
2424
<!-- endSnippet -->
2525

2626
The above configuration snippet configures ServiceComposer to handle HTTP requests matching the template. Each time a matching request is dealt with, ServiceComposer invokes each configured gatherer and merges responses from each one into a response returned to the original issuer.
@@ -40,7 +40,7 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
4040
{
4141
Gatherers = new List<Gatherer>
4242
{
43-
new Gatherer("ASamplesSource", "https://a.web.server/api/samples/ASamplesSource")
43+
new HttpGatherer("ASamplesSource", "https://a.web.server/api/samples/ASamplesSource")
4444
{
4545
DestinationUrlMapper = (request, destination) => destination.Replace(
4646
"{this-is-contextual}",
@@ -66,9 +66,9 @@ If there is a need to transform downstream data to respect the expected format,
6666
<!-- snippet: scatter-gather-transform-response -->
6767
<a id='snippet-scatter-gather-transform-response'></a>
6868
```cs
69-
public class CustomGatherer : Gatherer
69+
public class CustomHttpGatherer : HttpGatherer
7070
{
71-
public CustomGatherer(string key, string destination) : base(key, destination) { }
71+
public CustomHttpGatherer(string key, string destination) : base(key, destination) { }
7272

7373
protected override Task<IEnumerable<JsonNode>> TransformResponse(HttpResponseMessage responseMessage)
7474
{
@@ -78,7 +78,7 @@ public class CustomGatherer : Gatherer
7878
}
7979
}
8080
```
81-
<sup><a href='/src/Snippets/ScatterGather/TransformResponse.cs#L11-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-scatter-gather-transform-response' title='Start of snippet'>anchor</a></sup>
81+
<sup><a href='/src/Snippets/ScatterGather/TransformResponse.cs#L12-L24' title='Snippet source file'>snippet source</a> | <a href='#snippet-scatter-gather-transform-response' title='Start of snippet'>anchor</a></sup>
8282
<!-- endSnippet -->
8383

8484
### Taking control of the downstream invocation process
@@ -88,9 +88,9 @@ If transforming returned data is not enough, it's possible to take full control
8888
<!-- snippet: scatter-gather-gather-override -->
8989
<a id='snippet-scatter-gather-gather-override'></a>
9090
```cs
91-
public class CustomGatherer : Gatherer
91+
public class CustomHttpGatherer : HttpGatherer
9292
{
93-
public CustomGatherer(string key, string destination) : base(key, destination) { }
93+
public CustomHttpGatherer(string key, string destination) : base(key, destination) { }
9494

9595
public override Task<IEnumerable<JsonNode>> Gather(HttpContext context)
9696
{

0 commit comments

Comments
 (0)