Udostępnij za pośrednictwem


SubmissionPublisher.Consume(IConsumer) Method

Definition

Processes all published items using the given Consumer function.

[Android.Runtime.Register("consume", "(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;", "GetConsume_Ljava_util_function_Consumer_Handler", ApiSince=33)]
public virtual Java.Util.Concurrent.CompletableFuture? Consume (Java.Util.Functions.IConsumer? consumer);
[<Android.Runtime.Register("consume", "(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;", "GetConsume_Ljava_util_function_Consumer_Handler", ApiSince=33)>]
abstract member Consume : Java.Util.Functions.IConsumer -> Java.Util.Concurrent.CompletableFuture
override this.Consume : Java.Util.Functions.IConsumer -> Java.Util.Concurrent.CompletableFuture

Parameters

consumer
IConsumer

the function applied to each onNext item

Returns

a CompletableFuture that is completed normally when the publisher signals onComplete, and exceptionally upon any error or cancellation

Attributes

Remarks

Processes all published items using the given Consumer function. Returns a CompletableFuture that is completed normally when this publisher signals Flow.Subscriber#onComplete() onComplete, or completed exceptionally upon any error, or an exception is thrown by the Consumer, or the returned CompletableFuture is cancelled, in which case no further items are processed.

Java documentation for java.util.concurrent.SubmissionPublisher.consume(java.util.function.Consumer<? super T>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to