Closed qazwsxedckll closed 8 months ago
In .NET, there are two methods generated, one which is more actor low level and can deal with reentrancy. the default impl of this method just calls the RPC version.
In the case where someone wants to use reentrancy, they can then override the low level method and handle it in there. For Go, we need a different approach as we don´t have overrides in the same sense as in OOP
Sorry but can you be a little more specific.
Do you mean two methods generated in public class {{Name}}Client
? The one without ISenderContext
is more low level? I cannot find any implementation of RequestAsync<object>(_id, {{../Name}}Actor.Kind, gr, ct);
in Proto.Cluster.Cluster
, only one with ISenderContext
.
Or do you mean the vitural method public virtual async Task {{Name}}({{LeadingParameterDefinition}}Action{{#if UseReturn}}<{{OutputName}}>{{/if}} respond, Action<string> onError)
which is meant to be overridden to handle reentrancy.
Request -> GrainA -> GrainB -> GrainA.
I find something like
ctx.RequestFuture
andctx.ReenterAfter
but I do not know how to do it in a cluster.Based on my understanding, I can either write my own
type ContextProducer func(*Cluster) Context
which turns every request reenterable or I have to add a method totype Context interface
I found https://github.com/asynkron/protoactor-dotnet/pull/913 but I cannot understand what is happening.