public abstract class EventSubscriber extends Object implements Subscriber<Map<String,Object>>
Constructor and Description |
---|
EventSubscriber(String subscriptionId) |
Modifier and Type | Method and Description |
---|---|
String |
getSubscriptionId() |
abstract void |
onComplete()
Successful terminal state.
|
abstract void |
onError(Throwable t)
Failed terminal state.
|
abstract void |
onNext(Map<String,Object> t)
Data notification sent by the
Publisher in response to requests to Subscription.request(int) . |
abstract void |
onSubscribe(Subscription s)
Invoked after calling
Publisher.subscribe(Subscriber) . |
public EventSubscriber(String subscriptionId)
subscriptionId
- subscription id which is used to match an event to subscription.public abstract void onSubscribe(Subscription s)
Subscriber
Publisher.subscribe(Subscriber)
.
No data will start flowing until Subscription.request(int)
is invoked.
It is the responsibility of this Subscriber
instance to call Subscription.request(int)
whenever more data is wanted.
The Publisher
will send notifications only in response to Subscription.request(int)
.
onSubscribe
in interface Subscriber<Map<String,Object>>
s
- Subscription
that allows requesting data via Subscription.request(int)
public abstract void onNext(Map<String,Object> t)
Subscriber
Publisher
in response to requests to Subscription.request(int)
.onNext
in interface Subscriber<Map<String,Object>>
t
- the element signaledpublic abstract void onError(Throwable t)
Subscriber
It is up to implementer to decide whether to cancel subscription or use Subscription.request(int)
and expect further notifications.
onError
in interface Subscriber<Map<String,Object>>
t
- the throwable signaledpublic abstract void onComplete()
Subscriber
No further events will be sent even if Subscription.request(int)
is invoked again.
onComplete
in interface Subscriber<Map<String,Object>>
public String getSubscriptionId()
Copyright © 2016. All rights reserved.