Mercurial > pub > ImplabNet
comparison Implab/Components/PollingComponent.cs @ 262:f1696cdc3d7a v3 v3.0.8
Added IInitializable.Initialize() overload
Added IRunnable.Start(), IRunnable.Start() overloads
Fixed cancellation of the current operation when Stop() is called
More tests
| author | cin |
|---|---|
| date | Mon, 16 Apr 2018 02:12:39 +0300 |
| parents | 547a2fc0d93e |
| children |
comparison
equal
deleted
inserted
replaced
| 261:05a87f575512 | 262:f1696cdc3d7a |
|---|---|
| 47 protected override async Task StopInternalAsync(CancellationToken ct) { | 47 protected override async Task StopInternalAsync(CancellationToken ct) { |
| 48 // component in Stopping state, no new polls will be scheduled | 48 // component in Stopping state, no new polls will be scheduled |
| 49 m_cancellation.Cancel(); | 49 m_cancellation.Cancel(); |
| 50 try { | 50 try { |
| 51 // await for pending poll | 51 // await for pending poll |
| 52 await m_poll; | 52 if (m_poll != null) |
| 53 await m_poll; | |
| 53 } catch (OperationCanceledException) { | 54 } catch (OperationCanceledException) { |
| 54 // OK | 55 // OK |
| 55 } | 56 } |
| 56 } | 57 } |
| 57 | 58 |
