rad
2.0.0
|
#include <coroActivity.hpp>
Public Member Functions | |
CoroActivity (std::string const &id, boost::asio::io_context &io_ctx, Args...args) | |
void | start () override |
void | stop () override |
CoroActivity (std::string const &id, boost::asio::io_context &io_ctx, Args...args) | |
void | start () override |
void | stop () override |
![]() | |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
Due to the nature of asynchronous operations in ASIO in that a cancellation is not guaranteed to not invoke a registered handler, they need to have a guaranteed lifetime. The coroutines also needs overlapping lifetimes for when an activity is stopped, but not yet deleted and started again.
The solution is to create a new shared object instance for each start and delegating cancellation to this object. This makes CoroActivity a coroutine factory of sorts.
|
inlineexplicit |
Create CoroActivity
|
inlineexplicit |
Create CoroActivity
|
inlineoverridevirtual |
Starts the activity by creating a new coroutine instance that provides the activity behaviour.
Implements scxml4cpp::Activity.
|
inlineoverridevirtual |
Starts the activity by creating a new coroutine instance that provides the activity behaviour.
Implements scxml4cpp::Activity.
|
inlineoverridevirtual |
Cancels coroutine, but does not guarantee that it's deleted since it might have an operation scheduled but not yet executed by asio. For this reason the implementation of CORO should cancel all its asynchronous activities and make sure not to perform any observable side effects.
Implements scxml4cpp::Activity.
|
inlineoverridevirtual |
Cancels coroutine, but does not guarantee that it's deleted since it might have an operation scheduled but not yet executed by asio. For this reason the implementation of CORO should cancel all its asynchronous activities and make sure not to perform any observable side effects.
Implements scxml4cpp::Activity.