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 spawn_task and join_task utilities #789

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

gabriele-0201
Copy link
Contributor

Utilities used to have an error handling approach that follows two rules:

  • Fail fast: If a panic occurs in a worker thread, the main thread waiting
    for that worker to complete will also panic, printing the original panic payload.
  • Forward errors that do not depend on non-mt logic.

The utilities do not cover any type of context propagation. I tried many solutions to add context to the panics and error results of the task, but I couldn't find a proper way to provide context for both in a nice way. Open to suggestions!
I decided to push the utilities anyway because with just a few lines of code they achieve the desired goals and simplify the codebase. You will see this in the next PR on this stack.

Copy link
Contributor Author

gabriele-0201 commented Feb 7, 2025

Copy link
Contributor

pepyakin commented Feb 7, 2025

This is not 100% what I had in mind, but this is definitely a step in the right direction and we can iterate in follow-ups.

Utilities used to have an error handling approach that follows two rules:
+ Fail fast: If a panic occurs in a worker thread, the main thread waiting
for that worker to complete will also panic, printing the original panic payload.
+ Forward errors that do not depend on non-mt logic.
Copy link
Contributor

pepyakin commented Feb 7, 2025

Merge activity

  • Feb 7, 6:48 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 7, 6:48 AM EST: A user merged this pull request with Graphite.

@pepyakin pepyakin merged commit ce3865f into master Feb 7, 2025
8 checks passed
@pepyakin pepyakin deleted the gm_add_task_result branch February 7, 2025 11:48
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