Microsoft.AspNet.SignalR.Client.Connection.SetTimeout C# (CSharp) Method

SetTimeout() private static method

private static SetTimeout ( System.TimeSpan delay, System.Action operation ) : IDisposable
delay System.TimeSpan
operation System.Action
return IDisposable
        private static IDisposable SetTimeout(TimeSpan delay, Action operation)
        {
            var cancellableInvoker = new ThreadSafeInvoker();

            TaskAsyncHelper.Delay(delay).Then(() => cancellableInvoker.Invoke(operation));

            // Disposing this return value will cancel the operation if it has not already been invoked.
            return new DisposableAction(() => cancellableInvoker.Invoke());
        }