-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.helpers.BlockingIterable<T> io.smallrye.mutiny.helpers.BlockingIterable<T> asIterable(int batchSize, Supplier<Queue<T>> supplier) Consumes the upstreamMultias an iterable.io.smallrye.mutiny.helpers.BlockingIterable<T> asIterable(Supplier<Context> contextSupplier) io.smallrye.mutiny.helpers.BlockingIterable<T> Consumes the upstreamMultias an iterable.asStream()Consumes the items from the upstreamMultias a blocking stream.Consumes the items from the upstreamMultias a blocking stream.with(Context context, Consumer<? super Flow.Subscription> onSubscription, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.with(Context context, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.with(Consumer<? super Flow.Subscription> onSubscription, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.Subscribes to theMultito start receiving the items.<S extends Flow.Subscriber<? super T>>
SwithSubscriber(S subscriber) Subscribes to theMultito get a subscription and then start receiving items ( based on the passed requests).
-
Constructor Details
-
MultiSubscribe
-
-
Method Details
-
withSubscriber
Subscribes to theMultito get a subscription and then start receiving items ( based on the passed requests).This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.If the
Multirejects the subscription attempt or otherwise fails it will fire afailureevent receiving byFlow.Subscriber.onError(Throwable).- Type Parameters:
S- the subscriber type- Parameters:
subscriber- the subscriber, must not benull- Returns:
- the passed subscriber
-
withSubscriber
Subscribes to theMultito get a subscription and then start receiving items ( based on the passed requests).This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleMultiSubscriber. AMultiSubscribershould only subscribe once to a singleMulti.If the
Multirejects the subscription attempt or otherwise fails it will fire afailureevent receiving byMultiSubscriber.onFailure(Throwable).- Type Parameters:
S- the subscriber type- Parameters:
subscriber- the subscriber, must not benull- Returns:
- the passed subscriber
-
with
public Cancellable with(Consumer<? super Flow.Subscription> onSubscription, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onSubscriptionreceives theFlow.Subscription, you must request items using theFlow.Subscription.request(long)methodonItemreceives the requested items if anyonFailurereceives the failure if anyonCompletereceives the completion event
This method returns a
Cancellableto cancel the subscription.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
onSubscription- the callback receiving the subscription, must not benullonItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
public Cancellable with(Context context, Consumer<? super Flow.Subscription> onSubscription, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onSubscriptionreceives theFlow.Subscription, you must request items using theFlow.Subscription.request(long)methodonItemreceives the requested items if anyonFailurereceives the failure if anyonCompletereceives the completion event
This method returns a
Cancellableto cancel the subscription.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
context- the context, must not benullonSubscription- the callback receiving the subscription, must not benullonItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
public Cancellable with(Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonFailurereceives the failure if anyonCompletereceives the completion event
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
onItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
public Cancellable with(Context context, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure, Runnable onComplete) Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonFailurereceives the failure if anyonCompletereceives the completion event
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
context- the context, must not benullonItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonFailurereceives the failure if any
So, you won't be notified on stream completion.
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti. *- Parameters:
onItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
public Cancellable with(Context context, Consumer<? super T> onItem, Consumer<? super Throwable> onFailure) Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonFailurereceives the failure if any
So, you won't be notified on stream completion.
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti. *- Parameters:
context- the context, must not benullonItem- the callback receiving the items, must not benullonFailure- the callback receiving the failure, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
Subscribes to theMultito start receiving the items.This method receives only the
onItemcallback, invoked on each item. So, you won't be notified on stream completion, and on failure the default failure handler is used.This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti. *- Parameters:
onItem- the callback receiving the items, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
Subscribes to theMultito start receiving the items.This method receives only the
onItemcallback, invoked on each item. So, you won't be notified on stream completion, and on failure the default failure handler is used.This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti. *- Parameters:
context- the context, must not benullonItem- the callback receiving the items, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonCompletereceives the completion event
So, you won't be notified on failure.
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
onItem- the callback receiving the items, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
with
Subscribes to theMultito start receiving the items.This method accepts the following callbacks:
onItemreceives the requested items if anyonCompletereceives the completion event
So, you won't be notified on failure.
This method returns a
Cancellableto cancel the subscription.Important: This method request
Long.MAX_VALUEitems.This is a "factory method" and can be called multiple times, each time starting a new
Flow.Subscription. EachFlow.Subscriptionwill work for only a singleFlow.Subscriber. AFlow.Subscribershould only subscribe once to a singleMulti.- Parameters:
context- the context, must not benullonItem- the callback receiving the items, must not benullonComplete- the callback receiving the completion event, must not benull- Returns:
- the cancellable object to cancel the subscription
-
asIterable
- Returns:
- a blocking iterable used to consume the items emitted by the upstream
Multi.
-
asIterable
@CheckReturnValue public io.smallrye.mutiny.helpers.BlockingIterable<T> asIterable(Supplier<Context> contextSupplier) - Parameters:
contextSupplier- the context supplier, must not benull, must not returnnull- Returns:
- a blocking iterable used to consume the items emitted by the upstream
Multi.
-
asIterable
@CheckReturnValue public io.smallrye.mutiny.helpers.BlockingIterable<T> asIterable(int batchSize, Supplier<Queue<T>> supplier) Consumes the upstreamMultias an iterable.- Parameters:
batchSize- the number of elements stored in the queuesupplier- the supplier of queue used internally, must not benull, must not returnnull- Returns:
- a blocking iterable used to consume the items emitted by the upstream
Multi.
-
asIterable
@CheckReturnValue public io.smallrye.mutiny.helpers.BlockingIterable<T> asIterable(Supplier<Context> contextSupplier, int batchSize, Supplier<Queue<T>> queueSupplier) Consumes the upstreamMultias an iterable.- Parameters:
contextSupplier- the context supplier, must not benull, must not returnnullbatchSize- the number of elements stored in the queuequeueSupplier- the supplier of queue used internally, must not benull, must not returnnull- Returns:
- a blocking iterable used to consume the items emitted by the upstream
Multi.
-
asStream
- Returns:
- a blocking stream to consume the items from the upstream
Multi.
-
asStream
- Parameters:
contextSupplier- the context supplier, must not benull, must not returnnull- Returns:
- a blocking stream to consume the items from the upstream
Multi.
-
asStream
Consumes the items from the upstreamMultias a blocking stream.- Parameters:
batchSize- the number of element stored in the queuesupplier- the supplier of queue used internally, must not benull, must not returnnull- Returns:
- a blocking stream used to consume the items from
Multi
-
asStream
@CheckReturnValue public Stream<T> asStream(Supplier<Context> contextSupplier, int batchSize, Supplier<Queue<T>> queueSupplier) Consumes the items from the upstreamMultias a blocking stream.- Parameters:
contextSupplier- the context supplier, must not benull, must not returnnullbatchSize- the number of element stored in the queuequeueSupplier- the supplier of queue used internally, must not benull, must not returnnull- Returns:
- a blocking stream used to consume the items from
Multi
-