240
|
1 using System;
|
|
2 using System.Threading;
|
|
3 using Implab.Parallels;
|
|
4
|
|
5 namespace Implab {
|
248
|
6 /// <summary>
|
|
7 /// The cancellation token signals to the worker that cancellation has been
|
|
8 /// requested, after the signal is received the worker decides wheather to
|
|
9 /// cancel its work or to continue.
|
|
10 /// </summary>
|
|
11 public class CancellationToken : AbstractEvent<Action<Exception>> {
|
|
12 public CancellationToken() {
|
|
13
|
240
|
14 }
|
248
|
15
|
|
16 public void RequestCancellation() {
|
240
|
17
|
|
18 }
|
|
19
|
248
|
20 public void RequestCancellation(Exception reason) {
|
240
|
21
|
|
22 }
|
|
23
|
248
|
24 protected override void SignalHandler(Action<Exception> handler) {
|
|
25 throw new NotImplementedException();
|
|
26 }
|
240
|
27 }
|
|
28 } |