XRPLF / clio

An XRP Ledger API Server
https://xrpl.org
ISC License
56 stars 48 forks source link

Async framework: combine cancel and stop #1367

Closed kuznetsss closed 2 months ago

kuznetsss commented 2 months ago

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 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.