You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GetWorkStatus() throws an exception when the grain has not been started yet, versus returning NotStarted.
if(_status== SyncWorkStatus.NotStarted){
Logger.LogError("{Method} was in a status of {WorkStatus}", nameof(GetWorkStatus), SyncWorkStatus.NotStarted);
DeactivateOnIdle();thrownew InvalidStateException(_status);}return Task.FromResult(_status);
In my use case I intended to start a long-running task (in my project a sequenceFactoryGrain eventually creates a sequenceGrain, working as a long-running task) in an idempotent way, like
but was surprised by the exception thrown when trying to check the current state.
My intent: If some external non-Orleans API call tries to start the factory to get a grain, but if somehow there is a timeout/cancellation/... and the API retries, I should be able to find out that the sequenceFactoryGrain is already processing and just tag along waiting for the long-running call to complete.
(ContinueWorkAndPollUntilResult is the same code as StartWorkAndPollUntilResult but without the Start call)
GetWorkStatus()
throws an exception when the grain has not been started yet, versus returningNotStarted
.In my use case I intended to start a long-running task (in my project a sequenceFactoryGrain eventually creates a sequenceGrain, working as a long-running task) in an idempotent way, like
but was surprised by the exception thrown when trying to check the current state.
My intent: If some external non-Orleans API call tries to start the factory to get a grain, but if somehow there is a timeout/cancellation/... and the API retries, I should be able to find out that the sequenceFactoryGrain is already processing and just tag along waiting for the long-running call to complete.
(
ContinueWorkAndPollUntilResult
is the same code asStartWorkAndPollUntilResult
but without theStart
call)Originally posted by @hendrikdevloed in #55 (comment)
I'll make the modification to allow retrieving
GetWorkStatus()
and set up a pull request.The text was updated successfully, but these errors were encountered: