75 : m_PrefetchManager(max_threads), m_Listener(
NULL)
124 iter->second->RequestToCancel();
195 for(
unsigned re_try = 0;; ){
211 "OME::PrefetchNotify: No listener already! Probably, late job."
IAppJobListener Interface for components that need to be notified about changes in Jobs.
CObjectManagerEngineAction(IAppJob *job)
bool Execute(CRef< CPrefetchRequest > token)
IAppJob & GetIAppJob(void)
CObjectManagerEngine(unsigned max_threads=3)
CObjectManagerEngine.
void PrefetchNotify(CRef< objects::CPrefetchRequest > token, EEvent event)
virtual void ResumeJob(IAppJob &job)
virtual void RequestCancel()
asyncronous request all jobs to Cancel
IAppJobEngineListener * m_Listener
objects::CPrefetchManager m_PrefetchManager
virtual void CancelJob(IAppJob &job)
Cancel job in the engine If job is not running yet - just remove from the pending queue otherwise use...
virtual TJobState GetJobState(IAppJob &job) const
virtual void StartJob(IAppJob &job, IEngineParams *params=NULL)
If Engine cannot start the Job and exception shall be thrown.
virtual void ShutDown()
stop any background threads and free resources associated with the Engine
virtual void SetListener(IAppJobEngineListener *listener)
For "active" mode set a Listener that will be notified when the state of a Job changes.
virtual void SuspendJob(IAppJob &job)
virtual bool IsActive()
Returns true if Engine supports "active" model i.e.
IAppJobEngineListener - receives notifications about changes in job state.
container_type::const_iterator const_iterator
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
virtual void RequestCancel()=0
RequestCancel() is called to notify the Job that it shall exit Run() function ASAP.
EJobState
Job states (describe FSM)
virtual void OnEngineJobStateChanged(IAppJob &job, TJobState new_state)=0
@ eEngineBusy
Engine is busy, caller needs to re-try the operation.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
EStatus
Status of the task.
@ eIdle
has not been placed in queue yet
@ eQueued
in the queue, awaiting execution
@ eExecuting
being executed
@ eFailed
failure during execution
@ eCompleted
executed successfully
@ eCanceled
canceled - possible only if canceled before processing was started or if method Execute() returns res...
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
@ eCanceled
Request canceled.