public RemoteAnswerCapability(PendingQuestion question, MemberAccessPath access) : base(question.RpcEndpoint) { _question = question ?? throw new ArgumentNullException(nameof(question)); _access = access ?? throw new ArgumentNullException(nameof(access)); _ = AwaitWhenResolved(); }
static async Task <Proxy> TransferOwnershipToDummyProxy(PendingQuestion question, MemberAccessPath access) { var result = await question.WhenReturned; var cap = access.Eval(result); var proxy = new Proxy(cap); cap?.Release(); return(proxy); }
public RemoteAnswerCapability(PendingQuestion question, MemberAccessPath access) : this(question, access, TransferOwnershipToDummyProxy(question, access)) { }
public RemoteAnswerCapability(PendingQuestion question, MemberAccessPath access, Task <Proxy> proxyTask) : base(question.RpcEndpoint) { _question = question ?? throw new ArgumentNullException(nameof(question)); _access = access ?? throw new ArgumentNullException(nameof(access)); _whenResolvedProxy = (proxyTask ?? throw new ArgumentNullException(nameof(proxyTask))).EnforceAwaitOrder(); }