You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "acelyc111 (via GitHub)" <gi...@apache.org> on 2023/04/19 10:29:49 UTC
[GitHub] [incubator-pegasus] acelyc111 opened a new pull request, #1458: feat(util): add cancel() for class defer
acelyc111 opened a new pull request, #1458:
URL: https://github.com/apache/incubator-pegasus/pull/1458
https://github.com/apache/incubator-pegasus/issues/887
Add function cancel() for class defer to cancel the callback, it's useful
if using defer to short circuit failures and cancel it after all conditions
passed.
For example:
```
auto cleanup = dsn::defer([this]() { release_db(); });
RETURN_NOT_OK(a);
RETURN_NOT_OK(b);
RETURN_NOT_OK(c);
cleanup.cancel();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org
[GitHub] [incubator-pegasus] empiredan merged pull request #1458: feat(util): add cancel() for class defer
Posted by "empiredan (via GitHub)" <gi...@apache.org>.
empiredan merged PR #1458:
URL: https://github.com/apache/incubator-pegasus/pull/1458
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org