예제 #1
0
        public static Task <TimeSpan> WaitForState(this AblyRealtime realtime, ConnectionState awaitedState)
        {
            if (realtime.Connection.State == awaitedState)
            {
                return(Task.FromResult(TimeSpan.Zero));
            }

            var connectionAwaiter = new ConnectionAwaiter(realtime.Connection, awaitedState);

            return(connectionAwaiter.Wait());
        }
예제 #2
0
        public static Task WaitForState(this IRealtimeClient realtime, ConnectionState awaitedState = ConnectionState.Connected)
        {
            var connectionAwaiter = new ConnectionAwaiter(realtime.Connection, awaitedState);

            return(connectionAwaiter.Wait());
        }