Package io.rxson.rxrest
Class FlowSubscriber
java.lang.Object
io.rxson.rxrest.FlowSubscriber
- All Implemented Interfaces:
Flow.Subscriber<List<ByteBuffer>>
- Direct Known Subclasses:
MonoReactiveSubscriber
,ReactiveSubscriber
public abstract class FlowSubscriber extends Object implements Flow.Subscriber<List<ByteBuffer>>
- Author:
- Mohamed Aly Bou Hanane
© 2020
A receiver of http messages (stream chunks), and Publisher of chunks as POJOs accordingly
-
Field Summary
Fields Modifier and Type Field Description protected long
n
protected org.jsfr.json.NonBlockingParser
nonBlockingParser
protected Flow.Subscription
subscription
protected org.jsfr.json.JsonSurfer
surfer
-
Constructor Summary
Constructors Constructor Description FlowSubscriber(org.jsfr.json.JsonSurfer surfer)
-
Method Summary
Modifier and Type Method Description long
getN()
void
onComplete()
void
onError(Throwable throwable)
void
onNext(List<ByteBuffer> buffers)
void
onSubscribe(Flow.Subscription subscription)
void
setN(long n)
Adds the given numbern
of items to the current unfulfilled demand for this subscription.
-
Field Details
-
subscription
-
surfer
protected final org.jsfr.json.JsonSurfer surfer -
nonBlockingParser
protected org.jsfr.json.NonBlockingParser nonBlockingParser -
n
protected long n
-
-
Constructor Details
-
FlowSubscriber
public FlowSubscriber(org.jsfr.json.JsonSurfer surfer)
-
-
Method Details
-
onSubscribe
- Specified by:
onSubscribe
in interfaceFlow.Subscriber<List<ByteBuffer>>
-
onNext
- Specified by:
onNext
in interfaceFlow.Subscriber<List<ByteBuffer>>
-
onError
- Specified by:
onError
in interfaceFlow.Subscriber<List<ByteBuffer>>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceFlow.Subscriber<List<ByteBuffer>>
-
getN
public long getN() -
setN
public void setN(long n)Adds the given numbern
of items to the current unfulfilled demand for this subscription. Ifn
is less than or equal to zero, the Subscriber will receive anonError
signal with anIllegalArgumentException
argument. Otherwise, the Subscriber will receive up ton
additionalonNext
invocations (or fewer if terminated).- Parameters:
n
- the increment of demand; a value ofLong.MAX_VALUE
may be considered as effectively unbounded
-