RegisteredRunner Class Reference

#include <RunnersRegistry.h>

Inheritance diagram for RegisteredRunner:

Public Types

typedef void(RegisteredRunner::* Method) ()
 a pointer to one of the above notification methods More...
 

Public Member Functions

virtual void bootstrapConfig ()
 
virtual void finalizeConfig ()
 
virtual void claimMemoryNeeds ()
 
virtual void useConfig ()
 
virtual void startReconfigure ()
 
virtual void syncConfig ()
 
virtual void startShutdown ()
 
virtual void endingShutdown ()
 
virtual ~RegisteredRunner ()
 
virtual void finishShutdown ()
 Meant for cleanup of services needed by the already destroyed objects. More...
 

Detailed Description

This API allows virtually any module to register its interest in receiving notification about initial configuration availability, configuration changes and other critical events in Squid lifetime without exposing the notifier to the details of the module.

For example, main.cc may activate registered I/O modules after parsing squid.conf and deactivate them before exiting, all without knowing what those I/O modules really are.

A module in this context is code providing a functionality or service to the rest of Squid, such as src/DiskIO/Blocking, src/fs/ufs, or Cache Manager. To receive notifications, a module must declare a RegisteredRunner child class and implement the methods corresponding to the events the module is interested in.

The order of events is documented in this header (where applicable), but the order in which runners are notified about a given event is undefined. If a specific notification order is required, split the event into two or more related event(s), documenting their relative order here. a runnable registrant API kids must override [only] the methods they are interested in

Definition at line 37 of file RunnersRegistry.h.

Member Typedef Documentation

◆ Method

typedef void(RegisteredRunner::* RegisteredRunner::Method) ()

Definition at line 94 of file RunnersRegistry.h.

Constructor & Destructor Documentation

◆ ~RegisteredRunner()

virtual RegisteredRunner::~RegisteredRunner ( )
inlinevirtual

Called after stopping the main loop and before releasing memory. Meant for quick/basic cleanup that does not require any other modules.

Definition at line 88 of file RunnersRegistry.h.

Member Function Documentation

◆ bootstrapConfig()

virtual void RegisteredRunner::bootstrapConfig ( )
inlinevirtual

Called right before parsing squid.conf. Meant for initializing/preparing configuration parsing facilities.

Reimplemented in NtlmAuthRr.

Definition at line 46 of file RunnersRegistry.h.

Referenced by SquidMain().

◆ claimMemoryNeeds()

virtual void RegisteredRunner::claimMemoryNeeds ( )
inlinevirtual

Called after finalizeConfig(). Meant for announcing memory reservations before memory is allocated.

Reimplemented in IpcIoRr, and MemStoreRr.

Definition at line 55 of file RunnersRegistry.h.

Referenced by RunConfigUsers().

◆ endingShutdown()

virtual void RegisteredRunner::endingShutdown ( )
inlinevirtual

Called after shutdown_lifetime grace period ends and before stopping the main loop. At least one main loop iteration is guaranteed after this call. Meant for cleanup and state saving that may require other modules.

Reimplemented in Auth::CredentialCacheRr, ConnStateData, Dns::ConfigRr, and IdleConnList.

Definition at line 84 of file RunnersRegistry.h.

Referenced by SignalEngine::FinalShutdownRunners().

◆ finalizeConfig()

virtual void RegisteredRunner::finalizeConfig ( )
inlinevirtual

Called after parsing squid.conf. Meant for setting configuration options that depend on other configuration options and were not explicitly configured.

Reimplemented in sslBumpCfgRr, and MemStoreRr.

Definition at line 51 of file RunnersRegistry.h.

Referenced by SquidMain().

◆ finishShutdown()

virtual void RegisteredRunner::finishShutdown ( )
inlinevirtual

Definition at line 91 of file RunnersRegistry.h.

Referenced by RunRegistered(), SquidShutdown(), TestRock::tearDown(), and watch_child().

◆ startReconfigure()

virtual void RegisteredRunner::startReconfigure ( )
inlinevirtual

Called after receiving a reconfigure request and before parsing squid.conf. Meant for modules that need to prepare for their configuration being changed [outside their control]. The changes end with the syncConfig() event.

Reimplemented in Dns::ConfigRr.

Definition at line 67 of file RunnersRegistry.h.

Referenced by mainReconfigureStart().

◆ startShutdown()

virtual void RegisteredRunner::startShutdown ( )
inlinevirtual

Called after receiving a shutdown request and before stopping the main loop. At least one main loop iteration is guaranteed after this call. Meant for cleanup and state saving that may require other modules.

Reimplemented in ConnStateData, and Rock::Rebuild.

Definition at line 78 of file RunnersRegistry.h.

Referenced by SignalEngine::doShutdown().

◆ syncConfig()

virtual void RegisteredRunner::syncConfig ( )
inlinevirtual

Called after parsing squid.conf during reconfiguration. Meant for adjusting the module state based on configuration changes.

Reimplemented in Auth::CredentialCacheRr, and PeerPoolMgrsRr.

Definition at line 71 of file RunnersRegistry.h.

Referenced by mainReconfigureFinish().

◆ useConfig()

virtual void RegisteredRunner::useConfig ( )
inlinevirtual

Called after claimMemoryNeeds(). Meant for activating modules and features using a finalized configuration with known memory requirements.

Reimplemented in ClientDbRr, SharedMemPagesRr, Ipc::Mem::RegisteredRunner, MemStoreRr, PeerPoolMgrsRr, SharedSessionCacheRr, and TransientsRr.

Definition at line 60 of file RunnersRegistry.h.

Referenced by RunConfigUsers().


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors