Inheritance: IRSessionInteraction
        public void Request(string prompt, int maxLength, TaskCompletionSource<string> requestTcs) {
            var request = new RSessionInteraction(requestTcs, _responseTcs, prompt, maxLength, Contexts);
            if (_createRequestTcs.TrySetResult(request)) {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled) {
                throw new OperationCanceledException();
            }
        }
        public void Request(IReadOnlyList<IRContext> contexts, string prompt, int maxLength, TaskCompletionSource<string> requestTcs) {
            var request = new RSessionInteraction(requestTcs, _responseTcs.Task, prompt, maxLength, contexts ?? new[] { RHost.TopLevelContext });
            if (_createRequestTcs.TrySetResult(request)) {
                _cancellationTokenRegistration.Dispose();
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled) {
                throw new OperationCanceledException();
            }
        }
Beispiel #3
0
        public void Request(string prompt, int maxLength, TaskCompletionSource <string> requestTcs)
        {
            var request = new RSessionInteraction(requestTcs, _responseTcs, prompt, maxLength, Contexts);

            if (_createRequestTcs.TrySetResult(request))
            {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled)
            {
                throw new OperationCanceledException();
            }
        }
Beispiel #4
0
        public void Request(IReadOnlyList <IRContext> contexts, string prompt, int maxLength, TaskCompletionSource <string> requestTcs)
        {
            var request = new RSessionInteraction(requestTcs, _responseTcs.Task, prompt, maxLength, contexts ?? new[] { RHost.TopLevelContext });

            if (_createRequestTcs.TrySetResult(request))
            {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled)
            {
                throw new OperationCanceledException();
            }
        }