Package org.reactivestreams
Interface Publisher<T,S extends Subscriber<T>>
-
- All Known Implementing Classes:
EventPublisher
public interface Publisher<T,S extends Subscriber<T>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
publish(java.lang.String subscriptionId, java.util.Map<java.lang.String,java.lang.Object> params)
RequestPublisher
to send data.void
subscribe(S s)
RequestPublisher
to start streaming data.
-
-
-
Method Detail
-
subscribe
void subscribe(S s)
RequestPublisher
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 singleSubscriber
.A
Subscriber
should only subscribe once to a singlePublisher
.If the
Publisher
rejects the subscription attempt or otherwise fails it will signal the error viaSubscriber.onError(java.lang.Throwable)
.- Parameters:
s
- theSubscriber
that will consume signals from thisPublisher
-
publish
void publish(java.lang.String subscriptionId, java.util.Map<java.lang.String,java.lang.Object> params) throws java.io.IOException
RequestPublisher
to send data.- Parameters:
subscriptionId
- the identifier forSubscriber
who will consume the eventparams
- the data that needs to be sent to theSubscriber
- Throws:
java.io.IOException
- an exception is thrown if the params cannot be serialized
-
-