nim-chronos/chronos
Jacek Sieka f56d286687
introduce `asyncraises` to core future utilities (#454)
* introduce `asyncraises` to core future utilities

Similar to the introduction of `raises` into a codebase, `asyncraises`
needs to be introduced gradually across all functionality before
deriving benefit.

This is a first introduction along with utilities to manage raises lists
and transform them at compile time.

Several scenarios ensue:

* for trivial cases, adding `asyncraises` is enough and the framework
deduces the rest
* some functions "add" new asyncraises (similar to what `raise` does in
"normal" code) - for example `wait` may raise all exceptions of the
future passed to it and additionally a few of its own - this requires
extending the raises list
* som functions "remove" raises (similar to what `try/except` does) such
as `nocancel` with blocks cancellations and therefore reduce the raising
set

Both of the above cases are currently handled by a macro, but depending
on the situation lead to code organisation issues around return types
and pragma limitations - in particular, to keep `asyncraises`
backwards-compatibility, some code needs to exist in two versions which
somewhat complicates the implementation.

* add `asyncraises` versions for several `asyncfutures` utilities
* when assigning exceptions to a `Future` via `fail`, check at compile
time if possible and at runtime if not that the exception matches
constraints
* fix `waitFor` comments
* move async raises to separate module, implement `or`
2023-10-24 16:21:07 +02:00
..
apps/http Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
internal introduce `asyncraises` to core future utilities (#454) 2023-10-24 16:21:07 +02:00
ioselects move test data to c file (#448) 2023-10-17 14:19:20 +02:00
streams Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
transports Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
unittest2 add connect cancellation test (#444) 2023-09-05 13:41:52 +03:00
apps.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00
asyncloop.nim Introduce chronos/internals, move some code (#453) 2023-10-17 20:25:25 +02:00
asyncproc.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
asyncsync.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
config.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
debugutils.nim Introduce `chronos/futures` (#405) 2023-06-07 20:04:07 +02:00
futures.nim Complete futures in closure finally (fix #415) (#449) 2023-10-16 10:38:11 +02:00
handles.nim clean up `Defect` (#404) 2023-06-05 22:21:50 +02:00
osdefs.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
oserrno.nim Add facility to emulate signals on Windows. (#357) 2023-06-02 01:53:20 +03:00
osutils.nim clean up `Defect` (#404) 2023-06-05 22:21:50 +02:00
ratelimit.nim Cancellation fixes and tests. (#445) 2023-09-15 19:38:39 +03:00
selectors2.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
sendfile.nim Recover `poll` engine and add tests. (#421) 2023-08-01 12:56:08 +03:00
srcloc.nim clean up `Defect` (#404) 2023-06-05 22:21:50 +02:00
threadsync.nim Asynchronous thread notification mechanism. (#406) 2023-07-21 15:51:36 +03:00
timer.nim clean up `Defect` (#404) 2023-06-05 22:21:50 +02:00
transport.nim exception tracking (#166) 2021-03-24 10:08:33 +01:00