Skip to content

Add .then() continuation to Task<T>#39

Merged
danvratil merged 4 commits intomainfrom
thennable
Jan 8, 2022
Merged

Add .then() continuation to Task<T>#39
danvratil merged 4 commits intomainfrom
thennable

Conversation

@danvratil
Copy link
Collaborator

@danvratil danvratil commented Jan 8, 2022

When it is not possible to co_await a coroutine, we may still want to handle the result
of the coroutine asynchronously. This change introduces Task<T>::then() continuation,
which can be passed a callback that is invoked when the coroutine represented by the Task
finishes.

@danvratil danvratil added the enhancement New feature or request label Jan 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2022

Unit Test Results

  6 files   -   1    6 suites   - 1   2m 42s ⏱️ -17s
13 tests ±  0  13 ✔️ +1  0 💤 ±0  0  - 1 
74 runs   - 11  74 ✔️  - 9  0 💤 ±0  0  - 2 

Results for commit 83e0a5b. ± Comparison against base commit 3f5900a.

♻️ This comment has been updated with latest results.

Sometimes it's not possible to co_await a Task, but it would still be
useful to handle the result of the asynchronous operation. This change
introduces a Task::then() member function, which takes a callback as
an argument. The callback will be invoked when the Task is finished.
@danvratil danvratil changed the title [WIP] Add .then() continuation to task Add .then() continuation to Task<T> Jan 8, 2022
@danvratil danvratil merged commit 4716cfc into main Jan 8, 2022
@danvratil danvratil deleted the thennable branch January 8, 2022 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant