enforces happy_eyeballs_connect_gap and happy_eyeballs_connect_limit More...

Inheritance diagram for SpareAllowanceGiver:
Collaboration diagram for SpareAllowanceGiver:

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()

SpareAllowanceGiver::SpareAllowanceGiver ( )
inline

Definition at line 115 of file HappyConnOpener.cc.

Member Function Documentation

◆ checkpoint()

void HappyOrderEnforcer::checkpoint ( )
inherited

◆ concurrencyLimitReached()

bool SpareAllowanceGiver::concurrencyLimitReached ( ) const
private

◆ dequeue()

◆ enqueue()

◆ forgetAllowance()

void SpareAllowanceGiver::forgetAllowance ( )
private

◆ jobDroppedAllowance()

void SpareAllowanceGiver::jobDroppedAllowance ( )

◆ 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()

void HappyOrderEnforcer::noteWaitOver ( )
privateinherited

◆ NoteWaitOver()

void HappyOrderEnforcer::NoteWaitOver ( void *  raw)
staticprivateinherited

Definition at line 217 of file HappyConnOpener.cc.

References assert, and HappyOrderEnforcer::noteWaitOver().

Referenced by HappyOrderEnforcer::startedWaiting().

◆ notify()

AsyncCall::Pointer SpareAllowanceGiver::notify ( const CbcPointer< HappyConnOpener > &  job)
overrideprivatevirtual

Implements HappyOrderEnforcer.

Definition at line 255 of file HappyConnOpener.cc.

References CallJobHere, and recordAllowance().

◆ readyNow()

bool SpareAllowanceGiver::readyNow ( const HappyConnOpener job) const
overridevirtual

◆ recordAllowance()

void SpareAllowanceGiver::recordAllowance ( )
private

Definition at line 286 of file HappyConnOpener.cc.

References concurrencyLevel, current_dtime, and lastAllowanceStart.

Referenced by jobGotInstantAllowance(), and notify().

◆ startedWaiting()

bool HappyOrderEnforcer::startedWaiting ( const HappyAbsoluteTime  lastStart,
const int  cfgTimeoutMsec 
) const
protectedinherited

◆ waiting()

bool HappyOrderEnforcer::waiting ( ) const
inlineprotectedinherited

Member Data Documentation

◆ concurrencyLevel

int SpareAllowanceGiver::concurrencyLevel = 0
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_

HappySpareWaitList HappyOrderEnforcer::jobs_
privateinherited

◆ lastAllowanceStart

HappyAbsoluteTime SpareAllowanceGiver::lastAllowanceStart = 0
private

Definition at line 139 of file HappyConnOpener.cc.

Referenced by jobDroppedAllowance(), readyNow(), and recordAllowance().

◆ name

const char* const HappyOrderEnforcer::name
inherited

Definition at line 69 of file HappyConnOpener.cc.

Referenced by HappyOrderEnforcer::startedWaiting().

◆ waitEnd_

HappyAbsoluteTime HappyOrderEnforcer::waitEnd_ = 0
mutableprivateinherited

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors