Class BidiActivityGate
java.lang.Object
com.shaft.capture.collector.BidiActivityGate
- All Implemented Interfaces:
BooleanSupplier
Tracks whether a
BidiBrowserEventCollector running alongside a
PollingBrowserEventCollector has delivered a signal recently, so the polling collector
can skip its own redundant script round-trips while BiDi is proven healthy, and resume full-rate
polling the moment BiDi goes quiet.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a gate using the default two-second grace period.BidiActivityGate(Duration gracePeriod) Creates a gate with a custom grace period. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReports whether BiDi has delivered a signal within the grace period.voidRecords that a BiDi collector just delivered a signal.
-
Constructor Details
-
BidiActivityGate
public BidiActivityGate()Creates a gate using the default two-second grace period. -
BidiActivityGate
Creates a gate with a custom grace period.- Parameters:
gracePeriod- how long BiDi activity keeps reporting healthy after the last signal
-
-
Method Details
-
recordActivity
public void recordActivity()Records that a BiDi collector just delivered a signal. -
getAsBoolean
public boolean getAsBoolean()Reports whether BiDi has delivered a signal within the grace period.- Specified by:
getAsBooleanin interfaceBooleanSupplier- Returns:
- true while BiDi is proven healthy
-