|
E-MailRelay
|
A class for running an exectuable in a separate process with an asychronous completion callback. More...
#include <gtask.h>
Public Member Functions | |
| Task (TaskCallback &, ExceptionHandler &eh, const std::string &exec_error_format=std::string(), const G::Identity &=G::Identity::invalid()) | |
| Constructor for a start()able object. More... | |
| ~Task () | |
| Destructor. More... | |
| void | start (const G::ExecutableCommand &commandline) |
| Starts the task by spawning a new process with the given command-line and also starting a thread to wait for it. More... | |
| void | stop () |
| Attempts to kill the spawned process and waits for it to terminate. More... | |
Friends | |
| class | GNet::TaskImp |
A class for running an exectuable in a separate process with an asychronous completion callback.
| GNet::Task::Task | ( | TaskCallback & | callback, |
| ExceptionHandler & | eh, | ||
| const std::string & | exec_error_format = std::string(), |
||
| const G::Identity & | id = G::Identity::invalid() |
||
| ) |
Constructor for a start()able object.
The two trailing parameters are passed to the G::NewProcess class.
| GNet::Task::~Task | ( | ) |
| void GNet::Task::start | ( | const G::ExecutableCommand & | commandline | ) |
Starts the task by spawning a new process with the given command-line and also starting a thread to wait for it.
The wait thread signals completion of the child process via the event loop and the TaskCallback interface. Throws Busy if still busy from a prior call to start().
| void GNet::Task::stop | ( | ) |
1.8.9.1