view Implab/CancellationToken.cs @ 248:5cb4826c2c2a v3

Added awaiters to promises Added static methods to Promise Resolve, Reject, All. Updated promise helpers
author cin
date Tue, 30 Jan 2018 01:37:17 +0300
parents fa6cbf4d8841
children
line wrap: on
line source

using System;
using System.Threading;
using Implab.Parallels;

namespace Implab {
    /// <summary>
    /// The cancellation token signals to the worker that cancellation has been
    /// requested, after the signal is received the worker decides wheather to
    /// cancel its work or to continue.
    /// </summary>
    public class CancellationToken : AbstractEvent<Action<Exception>> {
        public CancellationToken() {
            
        }
        
        public void RequestCancellation() {

        }

        public void RequestCancellation(Exception reason) {

        }
        
        protected override void SignalHandler(Action<Exception> handler) {
            throw new NotImplementedException();
        }
    }
}