Beispiel #1
0
 public StateActionWithContextScheduledAsyncTask(AbstractScheduledEventExecutor executor, Action <object, object> action, object context, object state,
                                                 PreciseTimeSpan deadline, CancellationToken cancellationToken)
     : base(executor, deadline, new TaskCompletionSource(state), cancellationToken)
 {
     this.action  = action;
     this.context = context;
 }
Beispiel #2
0
 public StateActionScheduledTask(AbstractScheduledEventExecutor executor, Action <object> action, object state, PreciseTimeSpan deadline)
     : base(executor, deadline, new TaskCompletionSource(state))
 {
     this.action = action;
 }
 public ActionScheduledAsyncTask(AbstractScheduledEventExecutor executor, Action action, PreciseTimeSpan deadline, CancellationToken cancellationToken)
     : base(executor, deadline, new TaskCompletionSource(), cancellationToken)
 {
     this.action = action;
 }
Beispiel #4
0
 protected ScheduledTask(AbstractScheduledEventExecutor executor, PreciseTimeSpan deadline, TaskCompletionSource promise)
 {
     this.Executor = executor;
     this.Promise  = promise;
     this.Deadline = deadline;
 }
 public ActionScheduledTask(AbstractScheduledEventExecutor executor, Action action, PreciseTimeSpan deadline)
     : base(executor, deadline, new TaskCompletionSource())
 {
     this.action = action;
 }
 protected ScheduledAsyncTask(AbstractScheduledEventExecutor executor, PreciseTimeSpan deadline, TaskCompletionSource promise, CancellationToken cancellationToken)
     : base(executor, deadline, promise)
 {
     this.cancellationToken             = cancellationToken;
     this.cancellationTokenRegistration = cancellationToken.Register(s => ((ScheduledAsyncTask)s).Cancel(), this);
 }