client: add *Builder::syncCancel(bool)
Option for asynchronous cancel (eg. implicitly through ~Operation).
This commit is contained in:
+28
-1
@@ -273,6 +273,32 @@ struct Tester {
|
||||
testOk1(!done.wait(2.1));
|
||||
}
|
||||
|
||||
void asyncCancel()
|
||||
{
|
||||
testShow()<<__func__;
|
||||
|
||||
struct info_t {
|
||||
client::Result actual;
|
||||
epicsEvent done;
|
||||
};
|
||||
auto info(std::make_shared<info_t>());
|
||||
|
||||
serv.start();
|
||||
|
||||
// not storing Operation -> immediate cancel()
|
||||
cli.info("mailbox")
|
||||
.syncCancel(false)
|
||||
.result([info](client::Result&& result) {
|
||||
info->actual = std::move(result);
|
||||
info->done.signal();
|
||||
})
|
||||
.exec();
|
||||
|
||||
cli.hurryUp();
|
||||
|
||||
testOk1(!info->done.wait(2.1));
|
||||
}
|
||||
|
||||
void orphan()
|
||||
{
|
||||
testShow()<<__func__;
|
||||
@@ -395,7 +421,7 @@ void testError(bool phase)
|
||||
|
||||
MAIN(testget)
|
||||
{
|
||||
testPlan(51);
|
||||
testPlan(52);
|
||||
testSetup();
|
||||
logger_config_env();
|
||||
Tester().testConnector();
|
||||
@@ -404,6 +430,7 @@ MAIN(testget)
|
||||
Tester().lazy();
|
||||
Tester().timeout();
|
||||
Tester().cancel();
|
||||
Tester().asyncCancel();
|
||||
Tester().orphan();
|
||||
Tester().manualExec();
|
||||
testError(false);
|
||||
|
||||
Reference in New Issue
Block a user