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

feat: add catchAsync for use with await #54

Closed
wants to merge 1 commit into from

Conversation

emizzle
Copy link

@emizzle emizzle commented Feb 12, 2025

Add a catchAsync template that is useful when catching an asynchronous operation, allowing cancellations to propagate.

Add a `catchAsync` template that is useful when catching an asynchronous operation, allowing cancellations to propagate.
@arnetheduck
Copy link
Owner

This is an interesting idea to explore - but nim-results is not the repository for it, ie it has no knowledge of the CancelledError type (which doesn't exist for async frameworks other than chronos).

Tighter Future/Result/CancelledError integration is on the wishlist for chronos itself, though I'm not sure this particular helper will be the way to go, ie I think we'll want to add this kind of helper together with the rest of Result support .. it's certainly worth opening a draft pr or issue in chronos to have it documented however.

@emizzle
Copy link
Author

emizzle commented Feb 14, 2025

No probs, added status-im/nim-chronos#568 👍

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.

2 participants