Esempio n. 1
0
        public async Task <DisposeResult> DisposeInstance(DisposeInstanceRequest request)
        {
            var(callIdSource, tcs) = disposeResultRegister.CreateAndAdd();
            request.CallId         = callIdSource;
            await this.worker.PostMessageAsync(request.Serialize());

            return(await tcs.Task);
        }
Esempio n. 2
0
        public async Task <DisposeResult> DisposeInstance(DisposeInstanceRequest request)
        {
            request.CallId = ++callIdSource;
            var res = new TaskCompletionSource <DisposeResult>();

            disposeResultSourceByCallId.Add(request.CallId, res);
            await this.worker.PostMessageAsync(request.Serialize());

            return(await res.Task);
        }