org.reactivestreams.Publisher Maven / Gradle / Ivy
package org.reactivestreams;
public interface Publisher> {
/**
* Request {@link Publisher} to start streaming data.
*
* This is a "factory method" and can be called multiple times, each time starting a new {@link Subscription}.
*
* Each {@link Subscription} will work for only a single {@link Subscriber}.
*
* A {@link Subscriber} should only subscribe once to a single {@link Publisher}.
*
* If the {@link Publisher} rejects the subscription attempt or otherwise fails it will
* signal the error via {@link Subscriber#onError}.
*
* @param s the {@link Subscriber} that will consume signals from this {@link Publisher}
*/
public void subscribe(S s);
}