XRPLF / clio

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

Async framework refactor stopToken #1380

Open godexsoft opened 2 months ago

godexsoft commented 2 months ago

Summary

Stop token is separate from cancellation flag atm. Let's see if it makes sense to combine the two under one token/context struct.

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