#include <ActionWriter.h>

Inheritance diagram for Mgr::ActionWriter:
Collaboration diagram for Mgr::ActionWriter:

Public Types

typedef CbcPointer< AsyncJobPointer
 

Public Member Functions

 ActionWriter (const Action::Pointer &anAction, const Comm::ConnectionPointer &conn)
 
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

virtual void start ()
 called by AsyncStart; do not call directly More...
 
virtual void swanSong ()
 
virtual bool doneAll () const
 whether positive goal has been reached More...
 
void scheduleStoreCopy ()
 request more action results from the store More...
 
void noteStoreCopied (StoreIOBuffer ioBuf)
 receive some action results from the store More...
 
void scheduleCommWrite (const StoreIOBuffer &ioBuf)
 tell Comm to write action results More...
 
void noteCommWrote (const CommIoCbParams &params)
 called by Comm after the action results are written More...
 
void noteCommClosed (const CommCloseCbParams &params)
 called by Comm if the client socket got closed More...
 
void close ()
 closes the local connection to the HTTP client, if any More...
 
void deleteThis (const char *aReason)
 
void mustStop (const char *aReason)
 
bool done () const
 the job is destroyed in callEnd() when done() More...
 
virtual const char * status () const
 internal cleanup; do not call directly More...
 

Static Protected Member Functions

static void NoteStoreCopied (void *data, StoreIOBuffer ioBuf)
 
static void Abort (void *param)
 called by Store if the entry is no longer usable More...
 

Protected Attributes

Comm::ConnectionPointer clientConnection
 HTTP client descriptor. More...
 
StoreEntryentry
 store entry with the cache manager response More...
 
store_clientsc
 our registration with the store More...
 
int64_t writeOffset
 number of bytes written to the client More...
 
AsyncCall::Pointer closer
 comm_close handler More...
 
char buffer [HTTP_REQBUF_SZ]
 action results; Store fills, Comm writes More...
 
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...
 

Private Member Functions

 CBDATA_CLASS (ActionWriter)
 

Private Attributes

Action::Pointer action
 action that fills the entry More...
 

Detailed Description

Creates Store entry, fills it using action's fillEntry(), and Comm-writes it using parent StoreToCommWriter.

Definition at line 22 of file ActionWriter.h.

Member Typedef Documentation

◆ Pointer

Definition at line 34 of file AsyncJob.h.

Constructor & Destructor Documentation

◆ ActionWriter()

Mgr::ActionWriter::ActionWriter ( const Action::Pointer anAction,
const Comm::ConnectionPointer conn 
)

Definition at line 19 of file ActionWriter.cc.

References action, debugs, and HERE().

Member Function Documentation

◆ Abort()

void Mgr::StoreToCommWriter::Abort ( void *  param)
staticprotectedinherited

◆ callEnd()

void AsyncJob::callEnd ( )
virtualinherited

◆ callException()

◆ callStart()

void AsyncJob::callStart ( AsyncCall call)
inherited

◆ canBeCalled()

bool AsyncJob::canBeCalled ( AsyncCall call) const
inherited

Definition at line 101 of file AsyncJob.cc.

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

Referenced by AsyncJob::swanSong().

◆ CBDATA_CLASS()

Mgr::ActionWriter::CBDATA_CLASS ( ActionWriter  )
private

◆ close()

void Mgr::StoreToCommWriter::close ( )
protectedinherited

◆ deleteThis()

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

◆ done()

◆ doneAll()

bool Mgr::StoreToCommWriter::doneAll ( ) const
protectedvirtualinherited

◆ mustStop()

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

Definition at line 69 of file AsyncJob.cc.

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

Referenced by HttpStateData::abortAll(), Ftp::Client::abortAll(), Comm::TcpAcceptor::acceptOne(), Adaptation::Ecap::XactionRep::adaptationAborted(), Adaptation::AccessCheck::callBack(), AsyncJob::callException(), Security::PeerConnector::connectionClosed(), HttpStateData::continueAfterParsingHeader(), Ftp::Client::ctrlClosed(), Adaptation::Iterator::handleAdaptationBlock(), Adaptation::Iterator::handleAdaptationError(), Log::TcpLogger::handleClosure(), Adaptation::Icap::Xaction::handleCommClosed(), 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().

◆ noteCommClosed()

void Mgr::StoreToCommWriter::noteCommClosed ( const CommCloseCbParams params)
protectedinherited

◆ noteCommWrote()

◆ noteStoreCopied()

void Mgr::StoreToCommWriter::noteStoreCopied ( StoreIOBuffer  ioBuf)
protectedinherited

◆ NoteStoreCopied()

void Mgr::StoreToCommWriter::NoteStoreCopied ( void *  data,
StoreIOBuffer  ioBuf 
)
staticprotectedinherited

◆ scheduleCommWrite()

◆ scheduleStoreCopy()

◆ start()

void Mgr::ActionWriter::start ( )
protectedvirtual

◆ Start()

◆ status()

◆ swanSong()

void Mgr::StoreToCommWriter::swanSong ( )
protectedvirtualinherited

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ action

Action::Pointer Mgr::ActionWriter::action
private

Definition at line 34 of file ActionWriter.h.

Referenced by ActionWriter(), and start().

◆ buffer

char Mgr::StoreToCommWriter::buffer[HTTP_REQBUF_SZ]
protectedinherited

Definition at line 68 of file StoreToCommWriter.h.

Referenced by Mgr::StoreToCommWriter::scheduleStoreCopy().

◆ clientConnection

◆ closer

AsyncCall::Pointer Mgr::StoreToCommWriter::closer
protectedinherited

◆ entry

◆ id

const InstanceId<AsyncJob> AsyncJob::id
protectedinherited

Definition at line 72 of file AsyncJob.h.

◆ inCall

◆ sc

◆ stopReason

const char* AsyncJob::stopReason
protectedinherited

◆ typeName

◆ writeOffset

int64_t Mgr::StoreToCommWriter::writeOffset
protectedinherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors