Base class for all state machines to receive notification of events. More...
#include <I_Continuation.h>
Inherits force_VFPT_to_top.
Inherited by ActionSink, AIO_Callback_handler, AIOCallback, AIOThreadInfo, AutoStopCont, BaseStatPagesHandler, BlasterUrlList, CacheContinuation, CacheDisk, CacheHostTableConfig, CacheRemoveCont, CacheSync, CC_FreerContinuation, CC_UpdateContinuation, CCCongestionDBTestCont, CCFailHistoryTestCont, CheckConnect, ClusterAccept, ClusterAPIPeriodicSM, ClusterCalloutContinuation, ClusterControl, ClusterHandlerBase, ClusterLoadMonitor, ClusterState, ClusterVConnectionCacheEvent, CmdCacheCont, config_update_cont, ConfigUpdateCallback, ConfigurationContinuation, CongestionDBCont, DeleterContinuation< C >, DereferContinuation< C >, DNSEntry, DNSHandler, FetchSM, FreeCallContinuation< C >, FreerContinuation, GlobalClusterPeriodicEvent, HostDBContinuation, HostDBSyncer, HostDBTestReverse, HostDBTestRR, Http2ConnectionState, HttpCacheSM, HttpConfigCont, HttpSM, HttpTunnel, ICPConfigUpdateCont, ICPPeerReadCont, ICPRequestCont, InactivityCop, KeepAliveConn, KeepAliveLockHandler, LogCollationAccept, LogCollationClientSM, LogCollationHostSM, LoggingCollateContinuation, LoggingFlushContinuation, LoggingPreprocContinuation, MachineStatusSM, MachineTimeoutContinuation, MultiCacheHeapGC, MultiCacheSync, NetAccept, NetHandler, NetTestDriver, NetTesterAccept, NetTesterSM, NetVCTest, ObjectReloadCont, OneWayTunnel, OOB_callback, OpenDir, PeriodicCont, PeriodicWakeup, PinnedDocTable, PluginVCCore, PollCont, PrefetchBlaster, PrefetchConfigCont, PrefetchConfigFreerCont, PrefetchUrlBlaster, ProtocolProbeTrampoline, RamCacheCLFUSCompressor, raw_stat_sync_cont, RecursiveHttpGet, RegressionCont, RegressionSM, RemapPlugins, retryDisposeOfDataBuffer, ServerSessionPool, SessionAccept, ShowCont, ShowStats, SignalContinuation, SnapCont, SnapStatsContinuation, SocksAccepter, SocksEntry, SocksProxy, SpdyClientSession, SSLNextProtocolTrampoline, Stop, sync_cont, TestAccept, TestAccept, TestDnsStateMachine, TestProxy, TestProxy, TrackerContinuation, TransformControl, TSHttpSMCallback, TSHttpSsnCallback, UDPConnection, UDPNetHandler, UDPReadContinuation, UpdateConfigManager, UpdateScheduler, UpdateSM, UpTest, UR_UpdateContinuation, VConnection, and Vol.
Public Member Functions | |
LINK (Continuation, link) | |
Link to other continuations. | |
int | handleEvent (int event=CONTINUATION_EVENT_NONE, void *data=0) |
Receives the event code and data for an Event. | |
Continuation (ProxyMutex *amutex=NULL) | |
Contructor of the Continuation object. | |
Data Fields | |
ContinuationHandler | handler |
The current continuation handler function. | |
Ptr< ProxyMutex > | mutex |
The Contination's lock. |
Base class for all state machines to receive notification of events.
The Continuation class represents the main abstraction mechanism used throughout the IO Core Event System to communicate its users the occurrence of an event. A Continuation is a lightweight data structure that implements a single method with which the user is called back.
Continuations are typically subclassed in order to implement event-driven state machines. By including additional state and methods, continuations can combine state with control flow, and they are generally used to support split-phase, event-driven control flow.
Given the multithreaded nature of the Event System, every continuation carries a reference to a ProxyMutex object to protect its state and ensure atomic operations. This ProxyMutex object must be allocated by continuation-derived classes or by clients of the IO Core Event System and it is required as a parameter to the Continuation's class constructor.
Definition at line 94 of file I_Continuation.h.
Continuation::Continuation | ( | ProxyMutex * | amutex = NULL |
) | [inline] |
Contructor of the Continuation object.
It should not be used directly. Instead create an object of a derived type.
amutex | Lock to be set for this Continuation. |
Definition at line 192 of file I_Continuation.h.
int Continuation::handleEvent | ( | int | event = CONTINUATION_EVENT_NONE , |
|
void * | data = 0 | |||
) | [inline] |
Receives the event code and data for an Event.
This function receives the event code and data for an event and forwards them to the current continuation handler. The processor calling back the continuation is responsible for acquiring its lock.
event | Event code to be passed at callback (Processor specific). | |
data | General purpose data related to the event code (Processor specific). |
Reimplemented in BlasterUrlList, PrefetchBlaster, KeepAliveConn, and KeepAliveLockHandler.
Definition at line 145 of file I_Continuation.h.
References handler.
Referenced by UnixNetVConnection::acceptEvent(), Vol::aggWrite(), Vol::aggWriteDone(), aio_thread_main(), ClusterHandler::beginClusterEvent(), cache_op_result_ClusterFunction(), CacheContinuation::callback_user(), CacheContinuation::callbackEvent(), UnixUDPConnection::callbackHandler(), CacheContinuation::callbackResultEvent(), ObjectReloadCont::CallBackUser(), CacheVC::callcont(), CacheVC::calluser(), UpdateScheduler::ChildExitEventHandler(), ClusterHandler::cluster_signal_and_update(), ClusterHandler::cluster_signal_and_update_locked(), ClusterAPIPeriodicSM::ClusterAPIPeriodicSMEvent(), HostDBContinuation::clusterResponseEvent(), ShowCont::complete(), ShowCont::complete_error(), PluginVCCore::connect_re(), OneWayTunnel::connection_closed(), UnixNetVConnection::connectUp(), DNSEntry::delayEvent(), Cache::deref(), CacheVC::derefRead(), HostDBContinuation::dnsEvent(), HostDBContinuation::dnsPendingEvent(), HttpSM::do_http_server_open(), ClusterHandler::do_open_local_requests(), HttpSM::do_remap_request(), CacheVC::evacuateDocDone(), CacheVC::evacuateReadHead(), ConfigUpdateCallback::event_handler(), TSHttpSsnCallback::event_handler(), EThread::execute(), RecursiveHttpGet::ExitEventHandler(), SocksEntry::free(), CongestionDBCont::get_congest_entry(), CongestionDBCont::get_congest_list(), HttpSM::get_http_schedule(), DNSProcessor::getby(), HttpUpdateSM::handle_api_return(), HttpPagesHandler::handle_callback(), CheckConnect::handle_connect(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), StatPagesManager::handle_http(), HttpSM::handle_server_setup_error(), CacheContinuation::handleReplyEvent(), UpdateSM::HandleSMEvent(), CacheVC::handleWrite(), CacheVC::handleWriteLock(), ICPPeerReadCont::ICPPeerQueryCont(), ICPPeerReadCont::ICPPeerQueryEvent(), ObjectReloadCont::Init(), UpdateConfigManager::init(), ink_aio_read(), ink_aio_write(), APIHook::invoke(), AIOCallbackInternal::io_complete(), ClusterState::IOComplete(), HttpUpdateSM::kill_this_async_hook(), Cache::link(), CacheVC::linkWrite(), CacheContinuation::localVCsetupEvent(), Cache::lookup(), ShowCache::lookup_url(), CacheContinuation::lookupOpenWriteVC(), CacheContinuation::lookupOpenWriteVCEvent(), Http2ConnectionState::main_event_handler(), HttpTunnel::main_handler(), DNSEntry::mainEvent(), MultiCacheSync::mcEvent(), net_accept(), ObjectReloadCont::ObjectReloadEvent(), Cache::open_read(), HttpCacheSM::open_write(), Cache::open_write(), CacheVC::openReadFromWriterFailure(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseDir(), CacheVC::openWriteOverwrite(), CacheVC::openWriteStartBegin(), ICPPeerReadCont::PeerReadStateMachine(), RemapProcessor::perform_remap(), ICPHandlerCont::PeriodicEvent(), DNSEntry::postEvent(), HostDBContinuation::probeEvent(), EThread::process_event(), read_signal_and_update(), UDPReadContinuation::readPollEvent(), RecursiveHttpGet::RecursiveHttpGetEvent(), UDPNetProcessor::recvfrom_re(), CacheVC::reenable_re(), CacheContinuation::remoteOpEvent(), Cache::remove(), HostDBContinuation::remove_trigger_pending_dns(), HostDBContinuation::removeEvent(), CacheVC::removeEvent(), reply_to_cont(), RemapPlugins::run_remap(), Cache::scan(), CacheVC::scanObject(), CacheVC::scanOpenWrite(), CacheVC::scanRemoveDone(), CacheVC::scanUpdateDone(), CacheVC::scanVol(), UpdateScheduler::ScheduleEvent(), send_connection_event(), UnixNetVConnection::send_OOB(), send_plugin_event(), UDPNetProcessor::sendmsg_re(), HttpSM::setup_client_read_request_header(), CacheContinuation::setupReadWriteVC(), CacheContinuation::setupVCdataRead(), OpenDir::signal_readers(), ICPPeerReadCont::StaleCheck(), Http2ClientSession::start(), ClusterVConnection::start(), HttpUpdateSM::start_scheduled_update(), MultiCacheHeapGC::startEvent(), HttpConfig::startup(), stat_callback(), PluginVCCore::state_send_accept(), PluginVCCore::state_send_accept_failed(), HttpSM::state_watch_for_client_abort(), test(), testpage_callback(), RangeTransform::transform_to_range(), TSContCall(), TSHttpSsnReenable(), HttpTunnel::tunnel_run(), UDPNetProcessor::UDPBind(), CacheContinuation::VCdataRead(), and write_signal_and_update().
Continuation::LINK | ( | Continuation | , | |
link | ||||
) |
Link to other continuations.
A doubly-linked element to allow Lists of Continuations to be assembled.
The current continuation handler function.
The current handler should not be set directly. In order to change it, first aquire the Continuation's lock and then use the SET_HANDLER macro which takes care of the type casting issues.
Definition at line 107 of file I_Continuation.h.
Referenced by handleEvent().
The Contination's lock.
A reference counted pointer to the Continuation's lock. This lock is initialized in the constructor and should not be set directly.
Definition at line 121 of file I_Continuation.h.
Referenced by UnixNetProcessor::accept_internal(), UnixNetVConnection::acceptEvent(), NetAccept::acceptEvent(), NetAccept::acceptFastEvent(), HttpSessionManager::acquire_session(), HttpSM::add_cache_sm(), agg_copy(), Vol::aggWrite(), Vol::aggWriteDone(), aio_thread_main(), HttpSM::attach_client_session(), HttpSM::attach_server_session(), Vol::begin_read(), Vol::begin_read_lock(), UDPConnection::bindToThread(), ClusterHandler::build_controlmsg_descriptors(), Cache_dir(), cache_lookup_ClusterFunction(), cache_op_ClusterFunction(), cache_op_result_ClusterFunction(), CacheContinuation::cacheContAllocator_free(), CacheContinuation::callback_failure(), CacheContinuation::callback_user(), CacheVC::callcont(), ClusterCalloutContinuation::CalloutHandler(), CacheVC::calluser(), RegressionSM::child_done(), UpdateScheduler::ChildExitEventHandler(), ProxyClientSession::cleanup(), HttpSM::cleanup(), FetchSM::cleanUp(), SpdyClientSession::clear(), SpdyRequest::clear(), Vol::close_read(), Vol::close_read_lock(), OpenDir::close_write(), Vol::close_write_lock(), Cluster_lookup(), ClusterAccept::ClusterAccept(), ClusterCalloutContinuation::ClusterCalloutContinuation(), ClusterHandler::ClusterHandler(), ClusterLoadMonitor::ClusterLoadMonitor(), HostDBContinuation::clusterResponseEvent(), ClusterState::ClusterState(), clusterVCAllocator_free(), ClusterHandler::complete_channel_read(), RamCacheCLFUS::compress_entries(), ConfigurationContinuation::ConfigurationContinuation(), ClusterProcessor::connect_local(), PluginVCCore::connect_re(), UnixNetProcessor::connect_re_internal(), NetProcessor::connect_s(), Cache::deref(), CacheVC::derefRead(), INKVConnInternal::destroy(), INKContInternal::destroy(), HttpServerSession::destroy(), dir_clean_bucket(), dir_clear_range(), dir_delete(), dir_delete_lock(), dir_insert(), dir_insert_lock(), dir_lookaside_cleanup(), dir_lookaside_fixup(), dir_lookaside_insert(), dir_lookaside_probe(), dir_lookaside_remove(), dir_overwrite(), dir_overwrite_lock(), dir_probe(), dns_process(), dns_result(), NetAccept::do_blocking_accept(), UnixNetVConnection::do_io_close(), PluginVC::do_io_close(), CacheVC::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), PluginVC::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_write(), PluginVC::do_io_write(), CacheVC::do_io_write(), NetAccept::do_listen(), CacheContinuation::do_op(), HttpSM::do_post_transform_open(), HttpSM::do_range_setup_if_necessary(), CacheContinuation::do_remote_lookup(), HttpSM::do_transform_open(), ClusterState::doIO(), Vol::evacuate_cleanup_blocks(), evacuate_fragments(), CacheVC::evacuateDocDone(), Vol::evacuateDocReadDone(), CacheVC::evacuateReadHead(), ConfigUpdateCallback::event_handler(), RecursiveHttpGet::ExitEventHandler(), FetchSM::ext_destroy(), FetchSM::ext_init(), FetchSM::ext_read_data(), FetchSM::ext_write_data(), Vol::force_evacuate_head(), ObjectReloadCont::free(), UDPReadContinuation::free(), UnixNetVConnection::free(), SSLNetVConnection::free(), SocksProxy::free(), SocksEntry::free(), BlasterUrlList::free(), KeepAliveConn::free(), PrefetchBlaster::free(), PrefetchUrlBlaster::free(), free_CacheRemoveCont(), free_CacheVC(), Free_CongestionDBCont(), freelist_clean(), get_congest_entry(), get_congest_list(), get_hostinfo_ClusterFunction(), HttpSM::get_http_schedule(), DNSProcessor::getby(), HostDBProcessor::getbyname_imm(), UpdateConfigManager::GetConfigList(), UpdateConfigManager::GetConfigParams(), HostDBProcessor::getSRVbyname_imm(), INKVConnInternal::handle_event(), INKContInternal::handle_event(), HttpPagesHandler::handle_smdetails(), HttpPagesHandler::handle_smlist(), PrefetchBlaster::handleEvent(), CacheVC::handleRead(), CacheVC::handleReadDone(), CacheContinuation::handleReplyEvent(), UpdateSM::HandleSMEvent(), CacheVC::handleWrite(), CacheVC::handleWriteLock(), hostdb_cont_free(), ICPRequestCont::ICPRequestCont(), Vol::increment_generation(), ObjectReloadCont::Init(), SpdyClientSession::init(), SpdyRequest::init(), SocksProxy::init(), SocksEntry::init(), KeepAliveLockHandler::init(), PrefetchUrlBlaster::init(), BlasterUrlList::init(), KeepAliveConn::init(), PrefetchBlaster::init(), PluginVCCore::init(), OneWayTunnel::init(), OneWayMultiTunnel::init(), INKContInternal::init(), ICPPeerReadCont::init(), HttpTunnel::init(), HttpCacheSM::init(), HostDBContinuation::init(), FetchSM::init(), DNSEntry::init(), NetAccept::init_accept_per_thread(), SSLNetAccept::init_accept_per_thread(), init_HttpProxyServer(), NetVCTest::init_test(), UDPReadContinuation::init_token(), initialize_thread_for_net(), ClusterProcessor::internal_invoke_remote(), ClusterState::IOComplete(), UnixNetVConnection::load_buffer_and_write(), SSLNetVConnection::load_buffer_and_write(), Cache::lookup(), MachineStatusSM::MachineStatusSMEvent(), PluginVC::main_handler(), UnixNetVConnection::mainEvent(), SocksProxy::mainEvent(), CacheSync::mainEvent(), UDPNetHandler::mainNetEvent(), MultiCacheSync::mcEvent(), MultiCacheHeapGC::MultiCacheHeapGC(), MultiCacheSync::MultiCacheSync(), net_accept(), NetTesterSM::NetTesterSM(), new_CacheRemoveCont(), new_CacheVC(), HttpServerSession::new_connection(), HttpClientSession::new_connection(), Http2ClientSession::new_connection(), new_DocEvacuator(), ObjectReloadCont::ObjectReloadEvent(), OneWayMultiTunnel::OneWayMultiTunnel_free(), OneWayTunnel::OneWayTunnel_free(), DNSProcessor::open(), ClusterProcessor::open_local(), Cache::open_read(), Vol::open_write(), Cache::open_write(), OpenDir::open_write(), Vol::open_write_lock(), CacheVC::openReadChooseWriter(), CacheVC::openReadClose(), CacheVC::openReadFromWriter(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openReadStartEarliest(), CacheVC::openReadStartHead(), CacheVC::openWriteCloseDataDone(), CacheVC::openWriteCloseDir(), CacheVC::openWriteCloseHeadDone(), CacheVC::openWriteOverwrite(), CacheVC::openWriteWriteDone(), Action::operator=(), MultiCacheSync::pauseEvent(), ICPPeerReadCont::PeerReadStateMachine(), RemapProcessor::perform_remap(), PeriodicCont::PeriodicCont(), DNSEntry::post(), DNSEntry::postEvent(), ClusterHandler::process_incoming_callouts(), HttpSM::process_srv_info(), ClusterHandler::protoZombieEvent(), HttpSessionManager::purge_keepalives(), put_hostinfo_ClusterFunction(), ClusterControl::real_alloc_data(), UDPConnection::recv(), UnixNetVConnection::reenable(), UnixNetVConnection::reenable_re(), PluginVC::reenable_re(), HostDBContinuation::refresh_MD5(), register_ShowCache(), register_ShowCacheInternal(), RegressionSM::RegressionSM(), HttpSessionManager::release_session(), Cache::remove(), HostDBContinuation::removeEvent(), CacheVC::removeEvent(), CacheContinuation::replyOpEvent(), ICPPeerReadCont::reset(), INKVConnInternal::retry(), OOB_callback::retry_OOB_send(), RegressionSM::run(), CacheTestSM::run(), RemapPlugins::run_remap(), CacheVC::scanObject(), CacheVC::scanOpenWrite(), CacheVC::scanUpdateDone(), EventProcessor::schedule(), EThread::schedule(), Event::schedule_at(), Event::schedule_every(), Event::schedule_imm(), Event::schedule_in(), EThread::schedule_local(), UDPConnection::send(), LogCollationClientSM::send(), send_connection_event(), UnixNetVConnection::send_OOB(), send_plugin_event(), VIO::set_continuation(), UDPConnection::setContinuation(), CacheContinuation::setupReadBufTunnel(), OneWayTunnel::SetupTwoWayTunnel(), CacheContinuation::setupVCdataRead(), ShowNet::showConnectionsOnThread(), ShowCont::ShowCont(), ShowCacheInternal::showSegSegment(), ShowNet::showSingleThread(), ShowCacheInternal::showVolEvacuations(), ShowCacheInternal::showVolVolumes(), ClusterAccept::ShutdownDelete(), OpenDir::signal_readers(), EventProcessor::spawn_thread(), spdy_read_fetch_body_callback(), ICPPeerReadCont::StaleCheck(), Http2ClientSession::start(), HostDBProcessor::start(), ClusterVConnection::start(), HttpUpdateSM::start_scheduled_update(), HttpSM::start_sub_sm(), PVCTestDriver::start_tests(), ClusterHandler::startClusterEvent(), UnixNetVConnection::startEvent(), MultiCacheHeapGC::startEvent(), HttpSM::state_add_to_list(), HttpSM::state_api_callout(), HttpSM::state_http_server_open(), HttpSM::state_remove_from_list(), PluginVCCore::state_send_accept(), PluginVCCore::state_send_accept_failed(), TSAIORead(), TSAIOWrite(), TSContMutexGet(), TSHttpSsnReenable(), TSHttpTxnIntercept(), TSHttpTxnReenable(), TSHttpTxnServerIntercept(), TSVConnFdCreate(), UDPNetProcessorInternal::udp_callback(), UDPNetHandler::UDPNetHandler(), UDPReadContinuation::UDPReadContinuation(), ClusterHandler::update_channels_written(), Vol::Vol(), HostDBSyncer::wait_event(), write_dns(), write_dns_event(), ClusterAccept::~ClusterAccept(), ClusterCalloutContinuation::~ClusterCalloutContinuation(), ClusterState::~ClusterState(), ICPProcessor::~ICPProcessor(), ICPRequestCont::~ICPRequestCont(), KeepAliveLockHandler::~KeepAliveLockHandler(), LogCollationClientSM::~LogCollationClientSM(), NetVCTest::~NetVCTest(), PeriodicCont::~PeriodicCont(), PluginVC::~PluginVC(), PVCTestDriver::~PVCTestDriver(), TransformVConnection::~TransformVConnection(), UDPConnectionInternal::~UDPConnectionInternal(), and VolInitInfo::~VolInitInfo().