]> git.ipfire.org Git - thirdparty/squid.git/commit
Migrated RegisteredRunners to a multi-action interface.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Feb 2014 16:14:05 +0000 (09:14 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 Feb 2014 16:14:05 +0000 (09:14 -0700)
commit21b7990fa58c07ab6a1050fc1acd002ceb21e049
tree3b44d1c44f6de5e01a0857edbdcccf6c0b3bdb7f
parent28bd45ba856888db6a49c56f596aaf1af8da880c
Migrated RegisteredRunners to a multi-action interface.

Old generic two-action RegisteredRunners were good for handling paired
create/destroy events, but not all main.cc events fit that model well. In
fact, even the old runners implemented the destruction action for one event
only (rrAfterConfig); all other runners implemented a single action.

The adjusted API better supports runners that are interested in any number
of the supported events. It also allows a single runner object to handle
multiple events, which simplifies current code and may help with better
[re]configuration handling in the future.

Added startShutdown() and finishShutdown() events. The former will be needed
for authentication module shutdown and more polished shutdown initiation code
in general (patch pending). The latter is needed for final cleanup code that
previously ran as the destruction action for rrAfterConfig. finishShutdown()
also destroys all runners.

Note that the master process in SMP mode does not run startShutdown because
that process lacks the main loop and startShutdown() promises at least one
main loop iteration (to help with clean connections closures, for example).

Added syncConfig() event that will be needed for the standby pool
implementation (patch pending) and future code that reacts to Squid
configuration changes caused by reconfiguration.

"after config" event is now called "use config" to better match verb+noun or
action+object naming scheme.
16 files changed:
src/CollapsedForwarding.cc
src/DiskIO/IpcIo/IpcIoFile.cc
src/MemStore.cc
src/Transients.cc
src/base/RunnersRegistry.cc
src/base/RunnersRegistry.h
src/cache_cf.cc
src/client_db.cc
src/fs/rock/RockSwapDir.cc
src/fs/rock/RockSwapDir.h
src/ipc/mem/Pages.cc
src/ipc/mem/Segment.cc
src/ipc/mem/Segment.h
src/main.cc
src/ssl/support.cc
src/tests/testRock.cc