enforces happy_eyeballs_connect_gap and happy_eyeballs_connect_limit More...
Public Member Functions | |
SpareAllowanceGiver () | |
bool | readyNow (const HappyConnOpener &job) const override |
void | jobGotInstantAllowance () |
void | jobUsedAllowance () |
reacts to HappyConnOpener getting a spare connection opening result More... | |
void | jobDroppedAllowance () |
reacts to HappyConnOpener dropping its spare connection allowance More... | |
void | checkpoint () |
resumes jobs that need resuming (if any) More... | |
void | enqueue (HappyConnOpener &) |
starts managing the job's wait; the job should expect a call back More... | |
void | dequeue (HappyConnOpener &) |
stops managing the job's wait; cancels the pending callback, if any More... | |
Public Attributes | |
const char *const | name |
waiting event name, for debugging More... | |
Protected Member Functions | |
bool | waiting () const |
bool | startedWaiting (const HappyAbsoluteTime lastStart, const int cfgTimeoutMsec) const |
Private Member Functions | |
AsyncCall::Pointer | notify (const CbcPointer< HappyConnOpener > &) override |
bool | concurrencyLimitReached () const |
whether opening a spare connection now would violate happy_eyeballs_connect_limit More... | |
void | recordAllowance () |
account for the given allowance More... | |
void | forgetAllowance () |
void | noteWaitOver () |
Static Private Member Functions | |
static void | NoteWaitOver (void *raw) |
Private Attributes | |
HappyAbsoluteTime | lastAllowanceStart = 0 |
the time of the last noteSpareAllowance() call More... | |
int | concurrencyLevel = 0 |
HappySpareWaitList | jobs_ |
queued jobs waiting their turn More... | |
HappyAbsoluteTime | waitEnd_ = 0 |
expected NoteWaitOver() call time (or zero) More... | |
Detailed Description
Definition at line 112 of file HappyConnOpener.cc.
Constructor & Destructor Documentation
◆ SpareAllowanceGiver()
|
inline |
Definition at line 115 of file HappyConnOpener.cc.
Member Function Documentation
◆ checkpoint()
|
inherited |
Definition at line 173 of file HappyConnOpener.cc.
References CallBack(), HappyOrderEnforcer::jobs_, and HappyOrderEnforcer::readyNow().
Referenced by forgetAllowance(), and HappyOrderEnforcer::noteWaitOver().
◆ concurrencyLimitReached()
|
private |
Definition at line 303 of file HappyConnOpener.cc.
References concurrencyLevel, Config, SquidConfig::connect_limit, SquidConfig::happyEyeballs, and SquidConfig::workers.
Referenced by readyNow().
◆ dequeue()
|
inherited |
Definition at line 161 of file HappyConnOpener.cc.
References HappySpareWait::callback, AsyncCall::cancel(), HappyOrderEnforcer::jobs_, Must, HappySpareWait::position, and HappyConnOpener::spareWaiting.
Referenced by HappyConnOpener::stopGivingPrimeItsChance(), and HappyConnOpener::stopWaitingForSpareAllowance().
◆ enqueue()
|
inherited |
Definition at line 152 of file HappyConnOpener.cc.
References HappySpareWait::callback, HappySpareWait::codeContext, CodeContext::Current(), HappyOrderEnforcer::jobs_, Must, HappySpareWait::position, and HappyConnOpener::spareWaiting.
Referenced by HappyConnOpener::maybeGivePrimeItsChance(), and HappyConnOpener::maybeOpenSpareConnection().
◆ forgetAllowance()
|
private |
Definition at line 294 of file HappyConnOpener.cc.
References HappyOrderEnforcer::checkpoint(), concurrencyLevel, and Must.
Referenced by jobDroppedAllowance(), and jobUsedAllowance().
◆ jobDroppedAllowance()
void SpareAllowanceGiver::jobDroppedAllowance | ( | ) |
Definition at line 274 of file HappyConnOpener.cc.
References forgetAllowance(), and lastAllowanceStart.
Referenced by HappyConnOpener::noteSpareAllowance(), HappyConnOpener::stopWaitingForSpareAllowance(), and HappyConnOpener::swanSong().
◆ jobGotInstantAllowance()
void SpareAllowanceGiver::jobGotInstantAllowance | ( | ) |
reacts to HappyConnOpener discovering readyNow() conditions for a spare path the caller must attempt to open a spare connection immediately
Definition at line 262 of file HappyConnOpener.cc.
References recordAllowance().
Referenced by HappyConnOpener::maybeOpenSpareConnection().
◆ jobUsedAllowance()
void SpareAllowanceGiver::jobUsedAllowance | ( | ) |
Definition at line 268 of file HappyConnOpener.cc.
References forgetAllowance().
Referenced by HappyConnOpener::noteSpareConnectDone().
◆ noteWaitOver()
|
privateinherited |
Definition at line 224 of file HappyConnOpener.cc.
References HappyOrderEnforcer::checkpoint(), Must, HappyOrderEnforcer::waitEnd_, and HappyOrderEnforcer::waiting().
Referenced by HappyOrderEnforcer::NoteWaitOver().
◆ NoteWaitOver()
|
staticprivateinherited |
Definition at line 217 of file HappyConnOpener.cc.
References assert, and HappyOrderEnforcer::noteWaitOver().
Referenced by HappyOrderEnforcer::startedWaiting().
◆ notify()
|
overrideprivatevirtual |
Implements HappyOrderEnforcer.
Definition at line 255 of file HappyConnOpener.cc.
References CallJobHere, and recordAllowance().
◆ readyNow()
|
overridevirtual |
Implements HappyOrderEnforcer.
Definition at line 248 of file HappyConnOpener.cc.
References concurrencyLimitReached(), Config, SquidConfig::connect_gap, SquidConfig::happyEyeballs, lastAllowanceStart, and HappyOrderEnforcer::startedWaiting().
Referenced by HappyConnOpener::maybeOpenSpareConnection().
◆ recordAllowance()
|
private |
Definition at line 286 of file HappyConnOpener.cc.
References concurrencyLevel, current_dtime, and lastAllowanceStart.
Referenced by jobGotInstantAllowance(), and notify().
◆ startedWaiting()
|
protectedinherited |
Definition at line 189 of file HappyConnOpener.cc.
References assert, Config, current_dtime, eventAdd(), min(), HappyOrderEnforcer::name, HappyOrderEnforcer::NoteWaitOver(), HappyOrderEnforcer::waitEnd_, HappyOrderEnforcer::waiting(), and SquidConfig::workers.
Referenced by PrimeChanceGiver::readyNow(), and readyNow().
◆ waiting()
|
inlineprotectedinherited |
Definition at line 75 of file HappyConnOpener.cc.
References HappyOrderEnforcer::waitEnd_.
Referenced by HappyOrderEnforcer::noteWaitOver(), and HappyOrderEnforcer::startedWaiting().
Member Data Documentation
◆ concurrencyLevel
|
private |
the number of noteSpareAllowance() calls not already returned via jobUsedAllowance() or jobDroppedAllowance()
Definition at line 143 of file HappyConnOpener.cc.
Referenced by concurrencyLimitReached(), forgetAllowance(), and recordAllowance().
◆ jobs_
|
privateinherited |
Definition at line 82 of file HappyConnOpener.cc.
Referenced by HappyOrderEnforcer::checkpoint(), HappyOrderEnforcer::dequeue(), and HappyOrderEnforcer::enqueue().
◆ lastAllowanceStart
|
private |
Definition at line 139 of file HappyConnOpener.cc.
Referenced by jobDroppedAllowance(), readyNow(), and recordAllowance().
◆ name
|
inherited |
Definition at line 69 of file HappyConnOpener.cc.
Referenced by HappyOrderEnforcer::startedWaiting().
◆ waitEnd_
|
mutableprivateinherited |
Definition at line 83 of file HappyConnOpener.cc.
Referenced by HappyOrderEnforcer::noteWaitOver(), HappyOrderEnforcer::startedWaiting(), and HappyOrderEnforcer::waiting().
The documentation for this class was generated from the following file: