ShouldContinueToRepeat() public method

Inidicates that the IOLoop should retain this timeout, because it will be run again at some point in the future. Infrastructure.
public ShouldContinueToRepeat ( ) : bool
return bool
Beispiel #1
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout(begin, timespan, repeat, data, callback);

            ITimerWatcher timer;

            timer = context.CreateTimerWatcher(begin, timespan, delegate {
                t.Run(app);
                if (!t.ShouldContinueToRepeat())
                {
                    t.Stop();
                    timer.Dispose();
                }
            });

            timer.Start();

            return(t);
        }
Beispiel #2
0
        public static Timeout AddTimeout(TimeSpan begin, TimeSpan timespan, IRepeatBehavior repeat, object data, TimeoutCallback callback)
        {
            Timeout t = new Timeout (begin, timespan, repeat, data, callback);

            ITimerWatcher timer = null;
            timer = context.CreateTimerWatcher (begin, timespan, delegate {
                t.Run (app);
                if (!t.ShouldContinueToRepeat ()) {
                    t.Stop ();
                    timer.Dispose ();
                }
            });

            timer.Start ();

            return t;
        }