#include <AsyncJob.h>

Inheritance diagram for AsyncJob:
Collaboration diagram for AsyncJob:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 AsyncJob (const char *aTypeName)
 
bool canBeCalled (AsyncCall &call) const
 whether we can be called More...
 
void callStart (AsyncCall &call)
 
virtual void callEnd ()
 called right after the called job method More...
 
virtual void callException (const std::exception &e)
 called when the job throws during an async call More...
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static Pointer Start (AsyncJob *job)
 starts a freshly created job (i.e., makes the job asynchronous) More...
 

Protected Member Functions

void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
virtual void swanSong ()
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 
virtual ~AsyncJob ()
 

Protected Attributes

const char * stopReason
 reason for forcing done() to be true More...
 
const char * typeName
 kid (leaf) class name, for debugging More...
 
AsyncCall::Pointer inCall
 the asynchronous call being handled, if any More...
 
const InstanceId< AsyncJobid
 job identifier More...
 

Detailed Description

Base class for all asynchronous jobs

Definition at line 31 of file AsyncJob.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ AsyncJob()

AsyncJob::AsyncJob ( const char *  aTypeName)

Definition at line 30 of file AsyncJob.cc.

References debugs, and typeName.

◆ ~AsyncJob()

AsyncJob::~AsyncJob ( )
protectedvirtual

Definition at line 37 of file AsyncJob.cc.

References debugs, and typeName.

Referenced by swanSong().

Member Function Documentation

◆ callEnd()

void AsyncJob::callEnd ( )
virtual

called right after the called job method

Reimplemented in Adaptation::Icap::Xaction.

Definition at line 136 of file AsyncJob.cc.

References AsyncCall::debugLevel, debugs, AsyncCall::debugSection, done(), HERE(), inCall, NULL, status(), swanSong(), and typeName.

Referenced by Adaptation::Icap::Xaction::callEnd(), deleteThis(), and swanSong().

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)

called just before the called method

Definition at line 114 of file AsyncJob.cc.

References cbdataReferenceValid(), AsyncCall::debugLevel, debugs, AsyncCall::debugSection, inCall, Must, status(), CbdataParent::toCbdata(), and typeName.

Referenced by swanSong().

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const

Definition at line 101 of file AsyncJob.cc.

References AsyncCall::cancel(), debugs, HERE(), inCall, and NULL.

Referenced by swanSong().

◆ deleteThis()

void AsyncJob::deleteThis ( const char *  aReason)
protected

Definition at line 49 of file AsyncJob.cc.

References asyncCall(), callEnd(), debugs, inCall, JobMemFun(), Must, NULL, stopReason, and typeName.

◆ done()

◆ doneAll()

◆ mustStop()

void AsyncJob::mustStop ( const char *  aReason)
protected

Definition at line 69 of file AsyncJob.cc.

References debugs, inCall, Must, NULL, stopReason, and typeName.

Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), Http::Tunneler::handleConnectionClosure(), Mgr::Forwarder::handleError(), Ipc::Forwarder::handleError(), Ipc::Forwarder::handleException(), Ipc::Inquirer::handleException(), HttpStateData::handleMoreRequestBodyAvailable(), Ipc::Inquirer::handleRemoteAck(), Ipc::Forwarder::handleTimeout(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), Adaptation::Icap::ModXact::noteBodyConsumerAborted(), Snmp::Forwarder::noteCommClosed(), Snmp::Inquirer::noteCommClosed(), Mgr::Inquirer::noteCommClosed(), Mgr::Forwarder::noteCommClosed(), Mgr::StoreToCommWriter::noteCommClosed(), Adaptation::Icap::Xaction::noteCommRead(), Rock::HeaderUpdater::noteDoneReading(), Adaptation::Iterator::noteInitiatorAborted(), Adaptation::Icap::Xaction::noteInitiatorAborted(), Adaptation::Ecap::XactionRep::noteInitiatorAborted(), HttpStateData::readReply(), Comm::ConnOpener::sendAnswer(), Rock::Rebuild::start(), Security::PeerConnector::start(), HttpStateData::start(), Ipc::UdsSender::timedout(), and HttpStateData::wroteLast().

◆ Start()

◆ start()

◆ status()

◆ swanSong()

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ id

const InstanceId<AsyncJob> AsyncJob::id
protected

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ stopReason

const char* AsyncJob::stopReason
protected

◆ typeName


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors