7 ROS_INFO_STREAM(
"[" <<
getName() <<
"] Creating asynchronous onEntry thread");
18 ROS_INFO_STREAM(
"[" <<
getName() <<
"] onExit - join async onEntry thread");
28 auto status = this->
onEntryThread_.wait_for(std::chrono::milliseconds(20));
29 if (status == std::future_status::ready)
38 ROS_DEBUG(
"waiting for finishing client behavior");
41 catch (
const std::exception &e)
43 ROS_DEBUG(
"[SmaccAsyncClientBehavior] trying to Join onEntry function, but it was already finished.");
46 ROS_INFO_STREAM(
"[" <<
getName() <<
"] onExit - Creating asynchronous onExit thread");
56 ROS_DEBUG_STREAM(
"[" <<
getName() <<
"] Destroying client behavior- Waiting finishing of asynchronous onExit thread");
63 ROS_DEBUG(
"[SmaccAsyncClientBehavior] trying to Join onExit function, but it was already finished.");
66 ROS_DEBUG_STREAM(
"[" <<
getName() <<
"] Destroying client behavior- onExit thread finished. Proccedding destruction.");
std::string getName() const
virtual ~SmaccAsyncClientBehavior()
virtual void executeOnExit() override
std::future< int > onEntryThread_
std::function< void()> postFailureEventFn_
std::function< void()> postSuccessEventFn_
virtual void executeOnEntry() override
virtual void dispose() override
std::future< int > onExitThread_
std::function< void()> postFinishEventFn_