AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ ControlWaitUntil()

bool drama::Path::ControlWaitUntil ( std::chrono::steady_clock::time_point  until,
thread::TMessHandler action,
const std::string &  name,
const sds::Id argIn = sds::Id::CreateNullItem(),
sds::IdPtr *const  argOut = nullptr,
MessageEventHandler *const  eventProcessor = &_simpleEventProcessor 
)
inlineinherited

Sends a control message to a task and block the current thread until the reply is received or a timeout has occurred.

For a relative time, something like the following is needed. (ten second timeout).

   std::chrono::steady_clock::time_point until =  
      std::chrono::steady_clock::now() + std::chrono::seconds(10);
      ControlWaitUntil(until,...);
*

but can be done using the DeltaTimeToTimePoint() static method.

Parameters
untilUntil when should we wait for this.
actionA pointer to the threaded action or threaded uface handler which is executing this operation.
nameName of the control message to send.
argInArgument to the control message, if any.
eventProcessorAn object to use to process events. Defaults to a simple event processor that causes the method to return when the message completes.
argOutThe reply message argument, if any. An address of and sds::IdPtr is supplied. If you supply a
null pointer, it is ignored. Otherwise, any argument to the message completion is copied into here. If there is no argument to the reply, it will refer to a null SDS item.
Returns
Returns true if the transaction completed, false for a timeout.

References drama::TransEvtInfo::complete, drama::CreateRunDramaTask(), DramaTHROW_S, and drama::TransEvtInfo::entryStatus.