public interface Publisher<T,S extends Subscriber<T>>
void subscribe(S s)
Publisher
to start streaming data.
This is a "factory method" and can be called multiple times, each time starting a new Subscription
.
Each Subscription
will work for only a single Subscriber
.
A Subscriber
should only subscribe once to a single Publisher
.
If the Publisher
rejects the subscription attempt or otherwise fails it will
signal the error via Subscriber.onError(java.lang.Throwable)
.
s
- the Subscriber
that will consume signals from this Publisher
void publish(String subscriptionId, Map<String,Object> params) throws IOException
Publisher
to send data.subscriptionId
- the identifier for Subscriber
who will consume the eventparams
- the data that needs to be sent to the Subscriber
IOException
- an exception is thrown if the params cannot be serializedCopyright © 2016. All rights reserved.