Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Turowicz committed Aug 3, 2023
1 parent 8431701 commit d3edf52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ In production you should register the provider using the extension method for `I

```
siloBuilder.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage("PubSubStore")
.AddGrainsStreams("Default", 1);
.AddMemoryGrainStorage(name: "PubSubStore")
.AddGrainsStreams(name: "Default", queueCount: 1, retry: 3);
```

In test you should register the provider using the extension method for `ISiloBuilder`. It is also required to add Grains storage providers for actual state and for subscriptions. The example below uses `MemoryGrainStorage` which should not be used if you require the stream queues to be persistent. Additionally you need to provide types for all stream messages and how many queues we want to have per each message. In this situation, every `OnNextAsync` invocation can be awaited and the code will wait until that message is accepted by all subscribers.

```
siloBuilder.ConfigureServices(Configure)
.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage("PubSubStore")
.AddGrainsStreamsForTests("Default", 1, new[]
.AddMemoryGrainStorage(name: "PubSubStore")
.AddGrainsStreamsForTests(name: "Default", queueCount: 3, retry: 3, new[]
{
typeof(BlobMessage),
typeof(SimpleMessage),
Expand Down
8 changes: 4 additions & 4 deletions src/Orleans.Streaming.Grains.Tests/BaseGrainTestConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ public void Configure(ISiloBuilder siloBuilder)
{
siloBuilder.ConfigureServices(Configure)
.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage("PubSubStore")
.AddGrainsStreams("Default", 1, 3);
.AddMemoryGrainStorage(name: "PubSubStore")
.AddGrainsStreams(name: "Default", queueCount: 1, retry: 3);
}
else
{
#pragma warning disable CS0618
siloBuilder.ConfigureServices(Configure)
.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage("PubSubStore")
.AddGrainsStreamsForTests("Default", 3, 3, new[]
.AddMemoryGrainStorage(name: "PubSubStore")
.AddGrainsStreamsForTests(name: "Default", queueCount: 3, retry: 3, new[]
{
typeof(BlobMessage),
typeof(SimpleMessage),
Expand Down

0 comments on commit d3edf52

Please sign in to comment.