java.lang.Object
org.bsc.async.AsyncGenerator.Base<E>
org.bsc.async.AsyncGenerator.BaseCancellable<E>
org.bsc.async.AsyncGenerator.WithEmbed<E>
- Type Parameters:
E
- the type of elements in the generator
- All Implemented Interfaces:
Iterable<E>
,AsyncGenerator<E>
,AsyncGenerator.Cancellable<E>
,AsyncGenerator.HasResultValue
,AsyncGenerator.IsCancellable
- Enclosing interface:
- AsyncGenerator<E>
public static class AsyncGenerator.WithEmbed<E>
extends AsyncGenerator.BaseCancellable<E>
implements AsyncGenerator.HasResultValue
An asynchronous generator decorator that allows to generators composition embedding other generators.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bsc.async.AsyncGenerator
AsyncGenerator.Base<E>, AsyncGenerator.BaseCancellable<E>, AsyncGenerator.Cancellable<E>, AsyncGenerator.Data<E>, AsyncGenerator.Embed<E>, AsyncGenerator.EmbedCompletionHandler, AsyncGenerator.HasResultValue, AsyncGenerator.IsCancellable, AsyncGenerator.WithEmbed<E>, AsyncGenerator.WithResult<E>
-
Field Summary
Fields inherited from interface org.bsc.async.AsyncGenerator.IsCancellable
CANCELLED
-
Constructor Summary
ConstructorsConstructorDescriptionWithEmbed
(AsyncGenerator<E> delegate) WithEmbed
(AsyncGenerator<E> delegate, AsyncGenerator.EmbedCompletionHandler onGeneratorDoneWithResult) -
Method Summary
Methods inherited from class org.bsc.async.AsyncGenerator.BaseCancellable
isCancelled
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bsc.async.AsyncGenerator
flatMap, forEachAsync, iterator, map, reduce, reduceAsync, stream, toCompletableFuture
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
WithEmbed
public WithEmbed(AsyncGenerator<E> delegate, AsyncGenerator.EmbedCompletionHandler onGeneratorDoneWithResult) -
WithEmbed
-
-
Method Details
-
executor
- Specified by:
executor
in interfaceAsyncGenerator<E>
- Overrides:
executor
in classAsyncGenerator.Base<E>
-
resultValues
-
resultValue
- Specified by:
resultValue
in interfaceAsyncGenerator.HasResultValue
-
next
Description copied from interface:AsyncGenerator
Retrieves the next asynchronous element.- Specified by:
next
in interfaceAsyncGenerator<E>
- Returns:
- the next element from the generator
-
cancel
public boolean cancel(boolean mayInterruptIfRunning) Description copied from interface:AsyncGenerator.IsCancellable
method that request to cancel generator- Specified by:
cancel
in interfaceAsyncGenerator.IsCancellable
- Overrides:
cancel
in classAsyncGenerator.BaseCancellable<E>
-