Executes the submitted iRunnable tasks.
This interface provides a way of decoupling task submission from the mechanism of how each task will be run, including the details of thread use, scheduling, etc.
An executor is normally used instead of explicitly creating threads. However the it does not strictly require the execution to be asynchronous.
Public Member Functions | |
| virtual tBool | GetIsShutdown () const =0 |
| Returns true if this executor has been shut down. {Property}. More... | |
| virtual tBool | GetIsTerminated () const =0 |
| Returns true if all tasks have completed following shut down. {Property}. More... | |
| virtual ni::tBool | Execute (iRunnable *aRunnable)=0 |
| Executes the given runnable at some time in the future. More... | |
| virtual Ptr< ni::iFuture > | Submit (iRunnable *aRunnable)=0 |
| Executes the given runnable at some time in the future. More... | |
| virtual tBool | Shutdown (tU32 anTimeOut)=0 |
| Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Blocks until all tasks have completed execution or the timeout occurs. More... | |
| virtual tBool | ShutdownNow (tU32 anTimeOut)=0 |
| Attempts to cancel all actively executing tasks, halts the processing of waiting tasks. Blocks until all tasks have completed execution or the timeout occurs. More... | |
| virtual tU32 | Update (tU32 anTimeSliceInMs)=0 |
| Update the executor. More... | |
Public Member Functions inherited from iUnknown | |
| virtual tBool | IsOK () const =0 |
| Check if the object is valid. More... | |
| virtual tI32 | AddRef ()=0 |
| Signal that one more reference of the object has been created. More... | |
| virtual tI32 | Release ()=0 |
| Release a reference of the object. More... | |
| virtual void | DeleteThis ()=0 |
| Bypass any reference counting and delete this object. More... | |
| virtual void | Invalidate ()=0 |
| Invalidate the object. More... | |
| virtual iUnknown * | QueryInterface (const tUUID &aIID)=0 |
| Query an interface. More... | |
| virtual void | ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0 |
| Fill a UUID list containing the UUIDs of the implemented interfaces. More... | |
| virtual tI32 | SetNumRefs (tI32 anNumRefs)=0 |
| Set the reference counter directly. More... | |
| virtual tI32 | GetNumRefs () const =0 |
| Get the number of references to this object. More... | |
|
pure virtual |
Returns true if this executor has been shut down. {Property}.
|
pure virtual |
Returns true if all tasks have completed following shut down. {Property}.
Executes the given runnable at some time in the future.
The runnable might execute in a new thread, a thread pool, or in the calling thread, at the discretion of the executor implementation.
| aRunnable | the runnable to execute. |
|
pure virtual |
Executes the given runnable at some time in the future.
The runnable might execute in a new thread, a thread pool, or in the calling thread, at the discretion of the executor implementation.
| aRunnable | the runnable to execute. |
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Blocks until all tasks have completed execution or the timeout occurs.
Attempts to cancel all actively executing tasks, halts the processing of waiting tasks. Blocks until all tasks have completed execution or the timeout occurs.
Update the executor.
| anTimeSliceInMs | the suggested maximum time allocated to execute the runnables queued in the executor, at least one runnable is executed per update if any are queued. |
1.8.7