Package io.lettuce.core.protocol
Interface DemandAware.Sink
-
- Enclosing interface:
- DemandAware
public static interface DemandAware.Sink
A demand-awareDemandAware.Sink
that accepts data. It can signal itsDemandAware.Source
demand/readiness to emit more data. Instances of implementing classes are required to be thread-safe as they are shared amongst multiple threads.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasDemand()
void
removeSource()
Removes theDemandAware.Source
reference from thisDemandAware.Sink
.void
setSource(DemandAware.Source source)
Sets theDemandAware.Source
for aDemandAware.Sink
.
-
-
-
Method Detail
-
hasDemand
boolean hasDemand()
Returnstrue
if theDemandAware.Sink
has demand orfalse
if the source has no demand.false
means either theDemandAware.Sink
has no demand in general because data is not needed or the current demand is saturated.- Returns:
true
if theDemandAware.Sink
demands data.
-
setSource
void setSource(DemandAware.Source source)
Sets theDemandAware.Source
for aDemandAware.Sink
. TheDemandAware.Sink
is notified by thisDemandAware.Source
if the source indicates new demand or the sink catches up so it's ready to receive more data.- Parameters:
source
- the reference to the dataDemandAware.Source
, must not benull
.
-
removeSource
void removeSource()
Removes theDemandAware.Source
reference from thisDemandAware.Sink
. Any previously setDemandAware.Source
will no longer be asked for data.
-
-