#include <AsyncJob.h>


Public Types | |
typedef CbcPointer< AsyncJob > | Pointer |
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< AsyncJob > | id |
job identifier More... | |
Detailed Description
Base class for all asynchronous jobs
Definition at line 31 of file AsyncJob.h.
Member Typedef Documentation
◆ Pointer
typedef CbcPointer<AsyncJob> AsyncJob::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.
◆ ~AsyncJob()
|
protectedvirtual |
Definition at line 37 of file AsyncJob.cc.
Member Function Documentation
◆ 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(), and deleteThis().
◆ callException()
|
virtual |
Reimplemented in ClientHttpRequest, Ftp::Server, Ipc::Inquirer, Ipc::Forwarder, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Adaptation::Icap::ModXact, and ConnStateData.
Definition at line 127 of file AsyncJob.cc.
References cbdataReferenceValid(), debugs, Must, mustStop(), and CbdataParent::toCbdata().
Referenced by ConnStateData::callException(), Adaptation::Icap::Xaction::callException(), Ipc::Forwarder::callException(), Ipc::Inquirer::callException(), and Ftp::Server::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.
◆ canBeCalled()
bool AsyncJob::canBeCalled | ( | AsyncCall & | call | ) | const |
Definition at line 101 of file AsyncJob.cc.
References AsyncCall::cancel(), debugs, HERE(), inCall, and NULL.
◆ deleteThis()
|
protected |
Definition at line 49 of file AsyncJob.cc.
References asyncCall(), callEnd(), debugs, inCall, JobMemFun(), Must, NULL, stopReason, and typeName.
Referenced by ConnStateData::connStateClosed().
◆ done()
|
protected |
Definition at line 90 of file AsyncJob.cc.
References doneAll(), NULL, and stopReason.
Referenced by callEnd(), HappyConnOpener::checkForNewConnection(), and Downloader::downloadFinished().
◆ doneAll()
|
protectedvirtual |
Reimplemented in HappyConnOpener, Rock::Rebuild, Rock::HeaderUpdater, Snmp::Inquirer, Server, Security::PeerConnector, PeerPoolMgr, Mgr::StoreToCommWriter, Mgr::Inquirer, Log::TcpLogger, Ipc::UdsSender, Ipc::Port, Ipc::Inquirer, Ipc::Forwarder, Downloader, Comm::TcpAcceptor, Comm::ConnOpener, Http::Tunneler, Client, ClientHttpRequest, ConnStateData, BodySink, Adaptation::Iterator, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, Adaptation::Icap::ModXact, Adaptation::Icap::Launcher, Adaptation::Ecap::XactionRep, and Adaptation::AccessCheck.
Definition at line 96 of file AsyncJob.cc.
Referenced by done(), Adaptation::Ecap::XactionRep::doneAll(), Adaptation::Icap::Launcher::doneAll(), Adaptation::Icap::ServiceRep::doneAll(), Adaptation::Icap::Xaction::doneAll(), Adaptation::Iterator::doneAll(), BodySink::doneAll(), ConnStateData::doneAll(), ClientHttpRequest::doneAll(), Client::doneAll(), Comm::ConnOpener::doneAll(), Comm::TcpAcceptor::doneAll(), Downloader::doneAll(), Ipc::UdsSender::doneAll(), Log::TcpLogger::doneAll(), PeerPoolMgr::doneAll(), Security::PeerConnector::doneAll(), Server::doneAll(), Rock::HeaderUpdater::doneAll(), and Rock::Rebuild::doneAll().
◆ mustStop()
|
protected |
Definition at line 69 of file AsyncJob.cc.
References debugs, inCall, Must, NULL, stopReason, and typeName.
Referenced by HttpStateData::abortAll(), callException(), HttpStateData::continueAfterParsingHeader(), HttpStateData::drop1xx(), HttpStateData::handleMoreRequestBodyAvailable(), HttpStateData::httpStateConnClosed(), HttpStateData::httpTimeout(), Comm::ConnOpener::noteAbort(), HttpStateData::proceedAfter1xx(), ConnStateData::proxyProtocolError(), HttpStateData::readReply(), HttpStateData::start(), and HttpStateData::wroteLast().
◆ start()
|
protectedvirtual |
Reimplemented in Ipc::Port, Ftp::Server, HappyConnOpener, Rock::Rebuild, Rock::HeaderUpdater, Snmp::Inquirer, Server, Http::One::Server, Security::PeerConnector, PeerPoolMgr, Mgr::StoreToCommWriter, Mgr::Inquirer, Mgr::Filler, Mgr::ActionWriter, Log::TcpLogger, Ipc::UdsSender, Ipc::Strand, Ipc::Inquirer, Ipc::Forwarder, Ipc::Coordinator, HttpStateData, Downloader, Comm::TcpAcceptor, Comm::ConnOpener, Http::Tunneler, Ftp::Relay, Ftp::Gateway, Ftp::Client, ConnStateData, Adaptation::Iterator, Adaptation::Icap::Xaction, Adaptation::Icap::OptXact, Adaptation::Icap::ModXact, Adaptation::Icap::Launcher, Adaptation::Ecap::XactionRep, and Adaptation::AccessCheck.
Definition at line 43 of file AsyncJob.cc.
Referenced by Adaptation::AccessCheck::start(), Adaptation::Icap::Launcher::start(), Adaptation::Icap::Xaction::start(), Adaptation::Iterator::start(), ConnStateData::start(), Http::Tunneler::start(), Ipc::UdsSender::start(), PeerPoolMgr::start(), Security::PeerConnector::start(), Ipc::Port::start(), and Start().
◆ Start()
|
static |
Definition at line 23 of file AsyncJob.cc.
References CallJobHere, and start().
Referenced by Ftp::Server::AcceptCtrlConnection(), Ftp::Server::checkDataConnPre(), clientListenerConnectionOpened(), Ftp::Client::connectDataChannel(), FwdState::connectStart(), Adaptation::Icap::Xaction::dnsLookupDone(), Log::TcpLogger::doConnect(), FwdState::establishTunnelThruProxy(), TunnelStateData::establishTunnelThruProxy(), Ipc::Coordinator::handleCacheMgrRequest(), PeerPoolMgr::handleOpenedConnection(), Ipc::Coordinator::handleSnmpRequest(), httpAccept(), httpsAccept(), httpStart(), idnsInitVC(), Ftp::Gateway::listenForDataChannel(), Ftp::Server::listenForDataConnection(), Adaptation::Icap::Xaction::noteCommConnected(), Log::TcpLogger::Open(), HappyConnOpener::openFreshConnection(), PeerPoolMgr::openNewConnection(), peerProbeConnect(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), FwdState::secureConnectionToPeer(), TunnelStateData::secureConnectionToPeer(), Ipc::SendMessage(), Mgr::Inquirer::sendResponse(), snmpConstructReponse(), SquidMain(), CacheManager::start(), Ident::Start(), Adaptation::AccessCheck::Start(), Rock::Rebuild::Start(), Security::PeerConnector::startCertDownloading(), TunnelStateData::startConnecting(), Ftp::StartGateway(), Ftp::StartRelay(), PeerPoolMgrsRr::syncConfig(), and Rock::SwapDir::updateHeaders().
◆ status()
|
protectedvirtual |
for debugging, starts with space
Reimplemented in HappyConnOpener, Security::PeerConnector, Ipc::Inquirer, Comm::TcpAcceptor, Http::Tunneler, Adaptation::Initiate, Adaptation::Icap::Xaction, Adaptation::Icap::ServiceRep, and Adaptation::Ecap::XactionRep.
Definition at line 159 of file AsyncJob.cc.
References buf, NULL, and stopReason.
Referenced by callEnd(), callStart(), Adaptation::Initiate::status(), and Comm::TcpAcceptor::status().
◆ swanSong()
|
inlineprotectedvirtual |
Reimplemented in HappyConnOpener, Rock::Rebuild, Rock::HeaderUpdater, Snmp::Forwarder, Server, Security::PeerConnector, PeerPoolMgr, Mgr::StoreToCommWriter, Mgr::Forwarder, Mgr::Filler, Log::TcpLogger, Ipc::UdsSender, Ipc::Inquirer, Ipc::Forwarder, Downloader, Comm::TcpAcceptor, Comm::ConnOpener, Http::Tunneler, Ftp::Relay, Client, ConnStateData, Adaptation::Iterator, Adaptation::Initiate, Adaptation::Icap::Xaction, Adaptation::Icap::OptXact, Adaptation::Icap::ModXactLauncher, Adaptation::Icap::ModXact, Adaptation::Icap::Launcher, and Adaptation::Ecap::XactionRep.
Definition at line 54 of file AsyncJob.h.
Referenced by callEnd(), Client::swanSong(), Http::Tunneler::swanSong(), Comm::ConnOpener::swanSong(), Comm::TcpAcceptor::swanSong(), Ipc::UdsSender::swanSong(), Log::TcpLogger::swanSong(), PeerPoolMgr::swanSong(), Security::PeerConnector::swanSong(), Server::swanSong(), Rock::HeaderUpdater::swanSong(), and HappyConnOpener::swanSong().
◆ toCbdata()
|
pure virtualinherited |
Implemented in HttpStateData, ClientHttpRequest, and BodySink.
Referenced by callException(), and callStart().
Member Data Documentation
◆ id
|
protected |
Definition at line 72 of file AsyncJob.h.
◆ inCall
|
protected |
Definition at line 71 of file AsyncJob.h.
Referenced by callEnd(), callStart(), canBeCalled(), deleteThis(), and mustStop().
◆ stopReason
|
protected |
Definition at line 69 of file AsyncJob.h.
Referenced by deleteThis(), done(), mustStop(), status(), and HappyConnOpener::status().
◆ typeName
|
protected |
Definition at line 70 of file AsyncJob.h.
Referenced by AsyncJob(), Adaptation::Icap::Xaction::Xaction(), ~AsyncJob(), callEnd(), callStart(), deleteThis(), and mustStop().
The documentation for this class was generated from the following files:
- src/base/AsyncJob.h
- src/base/AsyncJob.cc