AceSmartSoft API Documentation
|
Decorator for QueryServerHandler to defer handling to another thread. More...
#include <smartProcessingPatterns.hh>
Public Types | |
using | IQueryServerHandlerPtr = std::shared_ptr< Smart::IQueryServerHandler< RequestType, AnswerType > > |
Public Member Functions | |
virtual int | start () override |
Creates and starts a new thread (if not yet started) More... | |
virtual int | stop (const bool wait_till_stopped=true) override |
Closes currently active thread (if it was started before) More... | |
ThreadQueueQueryHandler (Smart::IComponent *component, IQueryServerHandlerPtr inner_handler_ptr) | |
Create a new threaded QueryServerHandler Decorator. More... | |
virtual | ~ThreadQueueQueryHandler () |
![]() | |
Task (Smart::IComponent *component=0) | |
Constructor. More... | |
virtual | ~Task () |
Destructor. More... | |
virtual int | start (const ACE_Sched_Params &sched_params, const int &cpuAffinity=-1) |
control method to start the internal thread using given scheduling parameters More... | |
Additional Inherited Members | |
![]() | |
virtual bool | test_canceled () |
Tests whether the thread has been signaled to stop. More... | |
virtual void | sleep_for (const Smart::Duration &rel_time) |
Blocks execution of the calling thread during the span of time specified by rel_time. More... | |
virtual int | svc (void) |
implements ACE_Task<ACE_MT_SYNCH> More... | |
int | setCpuAffinity (const int &cpuCore) |
int | setSchedParams (const ACE_Sched_Params &sched_params) |
Decorator for QueryServerHandler to defer handling to another thread.
This Decorator (see Design Patterns by Gamma et. al) can be used if a QueryServerHandler is slow and/or blocking and would therefore block the framework. This handler is an active object and has a single thread, in which the Queries are handled one after another.
example usage:
using SmartACE::ThreadQueueQueryHandler< RequestType, AnswerType >::IQueryServerHandlerPtr = std::shared_ptr<Smart::IQueryServerHandler<RequestType,AnswerType> > |
|
inline |
Create a new threaded QueryServerHandler Decorator.
The internal handling thread is started/stopped automatically.
component | the pointer to the surrounding component |
inner_handler_ptr | which will be called in a separate thread. |
|
inlinevirtual |
|
inlineoverridevirtual |
Creates and starts a new thread (if not yet started)
Reimplemented from SmartACE::Task.
|
inlineoverridevirtual |
Closes currently active thread (if it was started before)
Reimplemented from SmartACE::Task.