We should provide only one way of canceling and stopping scheduled operations in async framework.
Motivation
Currently there are two parameters on scheduled operation callback - stopToken and bool. In most cases user doesn't need to know the reason of stopping.
Solution
We should simplify it to one parameter stopToken. Also in case user still need to get a reason of stopping we should add method reason() returning enum value Canceled or Stopped.
Summary
We should provide only one way of canceling and stopping scheduled operations in async framework.
Motivation
Currently there are two parameters on scheduled operation callback -
stopToken
andbool
. In most cases user doesn't need to know the reason of stopping.Solution
We should simplify it to one parameter
stopToken
. Also in case user still need to get a reason of stopping we should add methodreason()
returning enum valueCanceled
orStopped
.