Beispiel #1
0
            public LocalRequest NewRequest(BDict dict, CancellationToken cancellationToken = default)
            {
                LocalRequest result;

                lock (requests) {
                    result = new LocalRequest(autoIndex++, dict, requestTimeout, cancellationToken);
                    requests.Add(result);
                }
                result.CancellationTokenSource.Token.Register(() => {
                    Pop(result.Index);
                    result.Response.TrySetCanceled(result.CancellationTokenSource.Token);
                });
                return(result);
            }
Beispiel #2
0
 public RequestTimeoutException(LocalRequest requestSource) => RequestSource = requestSource;