feat: coroutines "beta test"#763
Merged
braindigitalis merged 9 commits intobrainboxdotcc:devfrom Aug 21, 2023
Merged
Conversation
✅ Deploy Preview for dpp-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
9dc4d8c to
b13caae
Compare
40877c0 to
921e040
Compare
Member
Author
|
|
6e6ba3b to
49b2cb5
Compare
Contributor
|
Please wrap all C++20 specific features in a |
Member
Author
|
DPP_CORO covers that. |
Mishura4
added a commit
to Mishura4/DPP-PRs
that referenced
this pull request
Aug 21, 2023
Mishura4
added a commit
to Mishura4/DPP-PRs
that referenced
this pull request
Aug 21, 2023
Mishura4
added a commit
to Mishura4/DPP-PRs
that referenced
this pull request
Aug 21, 2023
Mishura4
added a commit
to Mishura4/DPP-PRs
that referenced
this pull request
Aug 21, 2023
NOTE: this commit is part of a PR that was reorganized through rebases, and is very likely to not compile
Member
Author
|
This is finally ready for review. 👍 |
Jaskowicz1
reviewed
Aug 21, 2023
Mishura4
added a commit
to Mishura4/DPP-PRs
that referenced
this pull request
Aug 21, 2023
Jaskowicz1
reviewed
Aug 21, 2023
Member
Author
|
Btw I suggest merging this PR normally, without squash, so each changes gets listed in the changelog one by one |
braindigitalis
approved these changes
Aug 21, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dpp::task - coroutine object
Hot start (starts on constructor), executes in parallel
Can be cancelled which will throw dpp::task_cancelled_exception after the next co_await
Cannot detach, task will cancel itself when destroyed
Can be co-awaited later to retrieve return value
Requires synchronization at the point of co_await and destruction (lock-free)
dpp::coroutine - coroutine object
Lazy start (starts on co_await)
Has a return value, retrieved on co_await
Cannot detach or run in parallel by design of lazy start
No synchronization, light object
dpp::job - coroutine object
Hot start, runs in parallel and detached always, destroys itself when done
Cannot be co_awaited
No synchronization, no return value, very light object
dpp::async - awaitable API request (previously dpp::awaitable)
Can be constructed from a function
e.g:
dpp:async request = cluster->co_message_create(dpp::message{"foobar"});dpp::async request{cluster, &dpp::cluster::message_create, dpp::message{"foobar"}};Hot start (starts on constructor), executes in parallel
Lock-free synchronization on co_await