Disabling the population of the state when activating a grain during the invocation of a specific method
- Dominant language
- C#
- Stars
- 10.9k
- Forks
- 2.1k
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 345
Description
Hello,
We started to use Orleans in production several months ago and we are happy with that.
We noticed that the first activation of a grain is relatively slow. Logs show that the Orleans Runtime is spending dozens of milliseconds populating the state from Azure Blob Storage: in our case, this operation will never succeed as the state is not stored yet.
The user has to invoke a specific method in the Grain before calling other methods. This method is responsible for initializing the grain and storing information coming as arguments in the state.
Is it possible to make the population of the state configurable based on the method invoked in a grain ?
```csharp
public class ComputeGrain : Grain, IComputeGrain
{
// Method responsible for initializing the grain and storing different information coming from arguments in the state
public Task Initialize(Type1 arg1, Type2 arg2)
{
// No need to populate the state when activating the grain during the invocation of this method.
}
public Task DoSomething(int value)
{
// We have to populate the state when activating the grain during the invocation of this method.
}
}
```
Best regards,
Ahmed
Contributor guide
Assessment
This issue has not been assessed yet.