All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reactivestreams.Subscription Maven / Gradle / Ivy

Go to download

Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC

There is a newer version: 3.40.2
Show newest version
/***************************************************
 * Licensed under MIT No Attribution (SPDX: MIT-0) *
 ***************************************************/

package org.reactivestreams;

/**
 * A {@link Subscription} represents a one-to-one lifecycle of a {@link Subscriber} subscribing to a {@link Publisher}.
 * 

* It can only be used once by a single {@link Subscriber}. *

* It is used to both signal desire for data and cancel demand (and allow resource cleanup). */ public interface Subscription { /** * No events will be sent by a {@link Publisher} until demand is signaled via this method. *

* It can be called however often and whenever needed—but if the outstanding cumulative demand ever becomes Long.MAX_VALUE or more, * it may be treated by the {@link Publisher} as "effectively unbounded". *

* Whatever has been requested can be sent by the {@link Publisher} so only signal demand for what can be safely handled. *

* A {@link Publisher} can send less than is requested if the stream ends but * then must emit either {@link Subscriber#onError(Throwable)} or {@link Subscriber#onComplete()}. * * @param n the strictly positive number of elements to requests to the upstream {@link Publisher} */ public void request(long n); /** * Request the {@link Publisher} to stop sending data and clean up resources. *

* Data may still be sent to meet previously signalled demand after calling cancel. */ public void cancel(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy