Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async exception tracking #24582

Draft
wants to merge 11 commits into
base: devel
Choose a base branch
from
Draft

Conversation

nitely
Copy link
Contributor

@nitely nitely commented Dec 28, 2024

Somewhat inspired in chronos.

Goal:

  • Enable Exception Tracking for async. Using the native Nim exception tracking.
  • Enable passing error typed Futures around.
  • No runtime penalties.
  • Backward compatible.

How:

  • Await retrieves the raises list for the future. If the raises list cannot be resolved, then error gets inferred as Exception (the current behavior).
  • toFutureEx macro takes an async function call, and it returns the error typed future FutureEx[T, E] for passing it around.
  • Callbacks must not raise for this to work. It's possible to make this backward compatible, I think. Just deprecate the proc that takes a cb without raises: [], and cast it to untrack raises.

Todo:

  • tests
  • implement all, and, or FutureEx versions
  • fail proc for tracked exceptions; can it be done so it only accepts the type exceptions?
  • fix all XXX
  • check all nimble packages using async compile

@nitely nitely force-pushed the async_error_tracking branch from 2c0cebd to e648b93 Compare January 1, 2025 00:45
@nitely nitely closed this Jan 1, 2025
nitely added 5 commits January 1, 2025 03:32
gives uncomputedEffects for generics async proc
@nitely nitely reopened this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant