nim-codex/codex/utils
Eric 3e80de3454
Cancel and wait for asyncstatemachine futures when stopping (#493)
* Simplify `.then` (promise api) and tests

* Remove tracked future when cancelled. Add tracked future tests

* Track and cancel statemachine futures

The futures created in each asyncstatemachine instance are tracked, and each future is cancelled and waited in `stop`.

Change `asyncstatemachine.stop` to be async so `machine.trackedFutures.cancelAndWait` could be called.
Add a constructor for `asyncstatemachine` that initialises the `trackedFutures` instance, and call the constructor from derived class constructors.
2023-07-31 15:09:34 +10:00
..
addrutils.nim Improving proc/func formatting consistency (#454) 2023-06-22 08:11:18 -07:00
asyncheapqueue.nim Slot queue (#455) 2023-07-25 12:50:30 +10:00
asyncspawn.nim [marketplace] Load sales state from chain (#306) 2023-03-08 14:34:26 +01:00
asyncstatemachine.nim Cancel and wait for asyncstatemachine futures when stopping (#493) 2023-07-31 15:09:34 +10:00
fileutils.nim Enable stylecheck (#353) 2023-03-10 08:02:54 +01:00
keyutils.nim Fix warnings (drops Nim 1.2) (#348) 2023-03-09 12:23:45 +01:00
optionalcast.nim [utils] Add operator `as` for optional casting 2022-10-25 15:10:35 +11:00
stintutils.nim feat: bigint uses decimal over hex encoding (#452) 2023-06-21 07:46:18 +02:00
then.nim Cancel and wait for asyncstatemachine futures when stopping (#493) 2023-07-31 15:09:34 +10:00
timer.nim Improving proc/func formatting consistency (#454) 2023-06-22 08:11:18 -07:00
trackedfutures.nim Cancel and wait for asyncstatemachine futures when stopping (#493) 2023-07-31 15:09:34 +10:00