public TaskScheduler(Func <IJobQueue> JobQueueFactory, ITimeProvider timeProvider = null, Thread mainThread = null) { MainThread = mainThread ?? Thread.CurrentThread; TimeProvider = timeProvider ?? Time.DefaultTimeProvider; BackgroundTaskOnComplete = _BackgroundTaskOnComplete; OnResolvedDispatcher = _OnResolvedDispatcher; OnResolvedDispatcher_SkipQueue = _OnResolvedDispatcher_SkipQueue; mOnResolvedDispatcher_SkipQueue = GetType().GetMethod("_OnResolvedDispatcher_SkipQueue_Generic", BindingFlags.Instance | BindingFlags.NonPublic); _JobQueue = JobQueueFactory(); _SleepWorker = new Internal.WorkerThread <PriorityQueue <SleepItem> >( SleepWorkerThreadFunc, ThreadPriority.AboveNormal, "TaskScheduler Sleep Provider" ); SynchronizationContext = new TaskSchedulerSynchronizationContext(this); if (!_Default.IsValueCreated) { _Default.Value = this; WorkItemQueueTarget.SetDefaultIfNone(this); } else { _Default.Value = null; } }
public HttpServer(TaskScheduler scheduler) { EndPoints = new EndPointList(this); Scheduler = scheduler; RequestOnComplete = _RequestOnComplete; }
public SchedulableGeneratorThunk(IEnumerator <object> task) { _Task = task; _QueueStep = QueueStep; _QueueStepOnComplete = QueueStepOnComplete; _QueueStepOnDispose = QueueStepOnDispose; _OnErrorChecked = OnErrorChecked; _Step = Step; }
/// <summary> /// Registers an OnResolved handler onto a specified future that will push the onComplete handler /// onto this scheduler's work queue once the future is completed or disposed. /// </summary> /// <param name="skipQueueOnMainThread">If the future is completed/disposed from the main thread, run the handler synchronously</param> public void RegisterOnResolved <T> (Future <T> f, OnFutureResolved <T> onComplete, bool skipQueueOnMainThread = false) { RegisterOnResolved_Impl(f, onComplete, skipQueueOnMainThread); }
/// <summary> /// Registers an OnResolved handler onto a specified future that will push the onComplete handler /// onto this scheduler's work queue once the future is completed or disposed. /// </summary> /// <param name="skipQueueOnMainThread">If the future is completed/disposed from the main thread, run the handler synchronously</param> public void RegisterOnResolved(IFuture f, OnFutureResolved onResolved, bool skipQueueOnMainThread = false) { RegisterOnResolved_Impl(f, onResolved, skipQueueOnMainThread); }
public WriteThunk() { Result = new SignalFuture(); FlushOnComplete = _FlushOnComplete; }
public ReadToEndThunk() { Buffer = new CharacterBuffer(); OnDecodeComplete = _OnDecodeComplete; }
public ReadBlockThunk() { OnDecodeComplete = _OnDecodeComplete; }
internal PendingOperationManager() { OperationOnComplete = _OperationOnComplete; }
public OwnedFutureSet() { _OnComplete = OnComplete; _OnDispose = OnDispose; }