Replies: 1 comment
-
The library is responsible for defining what scheduler to use for callbacks. Some libraries, for example, Polly, have an argument in their methods such If you have no other option, you can always externally call a grain method from the callback, for example with: this.AsReference<IMyGrainInterface>().MyGrainMethod(); This ensures that the method code interleaves properly with other methods, as per whatever interleaving rules defined. This call will show up in the dashboard and telemetry, given it is an external call and therefore measured the same as other external calls. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
i started analyzing my GrainCode and also logged the current TaskScheduler in many parts of the code. I wanted to make sure, that all graincode is exexuted on Scheduler:ActivationTaskScheduler.
In some rare cases this is not the case. I came to the conclusion that a external library makes some trouble here. I'm using stateless to implement statemachines in my grains. Simplfied it works like:
Is there a elegant way to prevent this? One idea was, to wrap each callback in an internal GrainInterface. But the hole statemachine structure relies on callbacks ... so this will look very confusing.
Generall speaking ... is there a good way how to deal with library callbacks in orleans? :)
Thanks a lot.
Toni
Beta Was this translation helpful? Give feedback.
All reactions