8000 Return Task<T> from wrapper operations by danvratil · Pull Request #54 · qcoro/qcoro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Return Task<T> from wrapper operations #54

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

Merged
merged 11 commits into from
Apr 24, 2022
Merged

Conversation

danvratil
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor
github-actions bot commented Apr 23, 2022

Unit Test Results

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

Results for commit a415e48. ± Comparison against base commit 2c3e93b.

♻️ This comment has been updated with latest results.

@danvratil danvratil force-pushed the feature/task-operations branch 2 times, most recently from 5e31c1b to c59db9f Compare April 23, 2022 23:56
@danvratil danvratil force-pushed the feature/task-operations branch from 2363708 to a31cfbe Compare April 24, 2022 14:43
This means that every operation provided by the QCoro wrapper
classes now returns a Task<T>, so it's possible to use .then()
continuations with any operations provided by QCoro, e.g.

qCoro(socket).waitForConnected(then([](bool ok) { ... });

Previously qCoro(socket).waitForConnected() would return an
instance of QCoroAbstractSocket::WaitForConectedOperation,
which is an implementation detail of QCoro, which makes it
hard to combine it with functions (not coroutines!) that
return Task<T> and makes it much harder to support .then()
continuations everywhere.
Apparently, QPointer::get() has been introduced in Qt6.
@danvratil danvratil force-pushed the feature/task-operations branch from a31cfbe to f4bc03d Compare April 24, 2022 16:09
@danvratil danvratil merged commit 7e9b4a8 into main Apr 24, 2022
@danvratil danvratil deleted the feature/task-operations branch April 24, 2022 19:57
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
0