zingzeu / CrowdSource

Crowdsourcing coordination and state management tool
http://cs.mindong.asia
MIT License
2 stars 0 forks source link

handles de-activation in DummyStepLogic #45

Closed ztl8702 closed 5 years ago

ztl8702 commented 5 years ago

Previously, DummyStepLogic spawns a long-running thread that runs independently of the Grain thread. When the long-running job completes, it needs to update the Step status in the Grain. Doing so when the Grain has been de-activated will cause an access violation.

The solution is to use DirectClient support in Orleans and let the long running thread delegate schedule a grain call to set its status. _Call on the IStepGrain interface is introduced for this purpose.