Orleans.Streaming.Grains
8.0.115-rc1
dotnet add package Orleans.Streaming.Grains --version 8.0.115-rc1
NuGet\Install-Package Orleans.Streaming.Grains -Version 8.0.115-rc1
<PackageReference Include="Orleans.Streaming.Grains" Version="8.0.115-rc1" />
paket add Orleans.Streaming.Grains --version 8.0.115-rc1
#r "nuget: Orleans.Streaming.Grains, 8.0.115-rc1"
// Install Orleans.Streaming.Grains as a Cake Addin #addin nuget:?package=Orleans.Streaming.Grains&version=8.0.115-rc1&prerelease // Install Orleans.Streaming.Grains as a Cake Tool #tool nuget:?package=Orleans.Streaming.Grains&version=8.0.115-rc1&prerelease
Why?
This library allows you to use Grains Storage as a storage layer for Persistent Streams. Our benchmarks show 10% speed advantage over MemoryStreams
.
Orleans.Streaming.Grains
This is a Streaming Provider that uses Orleans' built-in StatefulGrain
system for queuing messages. The extra added value of this project is the FireAndForgetDelivery
option which can be disabled for tests, so they are easier to write with TestCluster
.
Usage
In production 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.
siloBuilder.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage(ProviderConstants.DEFAULT_PUBSUB_PROVIDER_NAME)
.AddGrainsStreams(name: ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME,
queueCount: 1,
retry: TimeSpan.FromMinutes(1),
poison: TimeSpan.FromMinutes(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. In this situation, every OnNextAsync
invocation can be awaited and the code will wait until that message is completed by all subscribers.
siloBuilder.ConfigureServices(Configure)
.AddMemoryGrainStorageAsDefault()
.AddMemoryGrainStorage(ProviderConstants.DEFAULT_PUBSUB_PROVIDER_NAME)
.AddGrainsStreamsForTests(name: ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME,
queueCount: 3,
retry: TimeSpan.FromSeconds(1),
poison: TimeSpan.FromSeconds(3));
Compromise
In high throughput and high volume environments you will want to collect the TransactionItemGrain
objects early so they don't overload the memory of your silo. Use the below configuration and adjust it to your requirements:
siloBuilder.Configure<GrainCollectionOptions>(options =>
{
options.CollectionAge = TimeSpan.FromMinutes(1);
options.CollectionQuantum = TimeSpan.FromSeconds(5);
options.ClassSpecificCollectionAge[typeof(TransactionItemGrain<>).FullName] = options.CollectionQuantum * 2;
});
Project Contents:
- Orleans.Streaming.Grains implements the Grain Stream Provider.
- Orleans.Streaming.Grains.Test test the Grain Stream Provider in an Orleans TestingHost.
Make sure to open the project folder in VS Code with Remote - Containers extension enabled.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Microsoft.Orleans.Streaming (>= 8.0.0-rc2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.0.115-rc1 | 453 | 12/21/2023 |
7.2.110 | 348 | 12/1/2023 |
7.2.108 | 120 | 12/1/2023 |
7.2.107 | 541 | 11/14/2023 |
7.2.105 | 134 | 11/14/2023 |
7.2.104 | 118 | 11/14/2023 |
7.2.103 | 149 | 11/8/2023 |
7.2.102 | 116 | 11/8/2023 |
7.2.101 | 116 | 11/8/2023 |
7.2.100 | 116 | 11/8/2023 |
7.2.99 | 106 | 11/8/2023 |
7.2.97 | 711 | 11/2/2023 |
7.2.96 | 128 | 11/2/2023 |
7.2.93 | 171 | 9/27/2023 |
7.2.92 | 135 | 9/27/2023 |
7.2.91 | 145 | 9/25/2023 |
7.2.90 | 127 | 9/25/2023 |
7.2.89 | 136 | 9/25/2023 |
7.2.88 | 135 | 9/25/2023 |
7.2.87 | 140 | 9/25/2023 |
7.2.86 | 120 | 9/21/2023 |
7.2.85 | 143 | 9/21/2023 |
7.2.83 | 108 | 9/21/2023 |
7.2.82 | 136 | 9/21/2023 |
7.2.81 | 143 | 9/20/2023 |
7.2.80 | 149 | 9/14/2023 |
7.2.79 | 126 | 9/13/2023 |
7.2.78 | 147 | 9/13/2023 |
7.2.76 | 175 | 9/11/2023 |
7.2.75 | 161 | 9/4/2023 |
7.2.74 | 124 | 9/1/2023 |
7.2.73 | 137 | 9/1/2023 |
7.2.69 | 154 | 8/29/2023 |
7.2.67 | 150 | 8/22/2023 |
7.2.65 | 156 | 8/4/2023 |
7.2.63 | 151 | 8/4/2023 |
7.2.61 | 173 | 8/3/2023 |
7.2.60 | 175 | 8/3/2023 |
7.2.54 | 162 | 8/2/2023 |
1.0.53 | 172 | 8/2/2023 |
1.0.50 | 144 | 8/2/2023 |
1.0.49 | 162 | 8/1/2023 |
1.0.48 | 172 | 8/1/2023 |
1.0.47 | 150 | 8/1/2023 |
1.0.46 | 168 | 8/1/2023 |
1.0.45 | 147 | 7/31/2023 |
1.0.44 | 153 | 7/28/2023 |
1.0.43 | 161 | 7/27/2023 |
1.0.42 | 164 | 7/27/2023 |
1.0.41 | 170 | 7/27/2023 |
1.0.40 | 140 | 7/27/2023 |
1.0.34 | 147 | 7/26/2023 |
1.0.21 | 161 | 7/25/2023 |
1.0.20 | 165 | 7/25/2023 |
1.0.19 | 172 | 7/25/2023 |
1.0.17 | 158 | 7/25/2023 |
1.0.16 | 154 | 7/25/2023 |
1.0.15 | 173 | 7/24/2023 |
1.0.14 | 160 | 7/21/2023 |
1.0.12 | 175 | 7/21/2023 |
1.0.11 | 152 | 7/21/2023 |
1.0.10 | 126 | 7/20/2023 |
1.0.9 | 186 | 7/20/2023 |
1.0.8 | 164 | 7/20/2023 |
1.0.6 | 182 | 7/20/2023 |
1.0.0 | 162 | 7/20/2023 |