Go to the documentation of this file.
31 stopReason(
NULL), typeName(aTypeName), inCall(
NULL)
33 debugs(93,5,
"AsyncJob constructed, this=" <<
this <<
34 " type=" <<
typeName <<
" [" <<
id <<
']');
39 debugs(93,5,
"AsyncJob destructed, this=" <<
this <<
40 " type=" <<
typeName <<
" [" <<
id <<
']');
86 debugs(93, 5,
typeName <<
" will stop, another reason: " << aReason);
107 call <<
" cannot reenter the job.");
108 return call.
cancel(
"reentrant job call");
142 void *thisSaved =
this;
149 debugs(93, 6,
HERE << *inCallSaved <<
" ended " << thisSaved);
168 buf.appendf(
" %s%u]",
id.prefix(),
id.value);
171 return buf.content();
bool cancel(const char *reason)
bool canBeCalled(AsyncCall &call) const
whether we can be called
AsyncCall::Pointer inCall
the asynchronous call being handled, if any
virtual void callEnd()
called right after the called job method
const char * stopReason
reason for forcing done() to be true
int cbdataReferenceValid(const void *p)
AsyncJob(const char *aTypeName)
virtual void * toCbdata()=0
virtual bool doneAll() const
whether positive goal has been reached
void mustStop(const char *aReason)
#define debugs(SECTION, LEVEL, CONTENT)
static Pointer Start(AsyncJob *job)
starts a freshly created job (i.e., makes the job asynchronous)
std::ostream & HERE(std::ostream &s)
#define CallJobHere(debugSection, debugLevel, job, Class, method)
NullaryMemFunT< C > JobMemFun(const CbcPointer< C > &job, typename NullaryMemFunT< C >::Method method)
InstanceIdDefinitions(AsyncJob, "job")
const char * typeName
kid (leaf) class name, for debugging
bool done() const
the job is destroyed in callEnd() when done()
virtual const char * status() const
internal cleanup; do not call directly
void deleteThis(const char *aReason)
void callStart(AsyncCall &call)
virtual void start()
called by AsyncStart; do not call directly
#define Must(condition)
Like assert() but throws an exception instead of aborting the process.
AsyncCall * asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
virtual void callException(const std::exception &e)
called when the job throws during an async call