예제 #1
0
        public void WhenSourceCompletes()
        {
            var f = sourceFuture.timeout(d, tc);

            f.value.shouldBeNone();
            tc.timePassed = d - new Duration(1);
            f.value.shouldBeNone();
            promise.complete(5);
            f.value.shouldBeSome(Either <Duration, int> .Right(5));
        }
예제 #2
0
파일: Static.cs 프로젝트: yika-aixi/tlplib
 /* Waits at most `timeout` for the future to complete. */
 public static Future <Either <Duration, A> > timeout <A>(
     this Future <A> future, Duration timeout, ITimeContext tc = null
     ) => future.timeout(timeout, () => timeout, tc);
예제 #3
0
 /* Waits at most `timeoutSeconds` for the future to complete. Completes with
  * TimeoutException<A> on timeout. */
 public static Future <Either <Duration, A> > timeout <A>(
     this Future <A> future, float timeoutSeconds
     ) => future.timeout(timeoutSeconds, () => new Duration(timeoutSeconds));