orleans
orleans copied to clipboard
Need a way to use built-in grain directory locally
When using an Azure Storage or Redis Grain Directory, it is difficult to test the code locally against the built-in directory unless the code to decorate the grain in commented or conditionally compiled. Is there an elegant way to serve this purpose.
That's a very good point, we should add the same config methods for the built-in directory, so you can use it with a name
If anyone else encounters the need for this, for now it seems registering a named singleton service IGrainDirectory with the name you need and a null implementation does the trick
hostBuilder.UseOrleans(builder =>
{
builder.ConfigureServices(services =>
{
services.AddSingletonNamedService("directory-name", (_, _) => (IGrainDirectory?)null);
});
}
});