Package io.servicetalk.concurrent.api
Class TestCompletable.Builder
- java.lang.Object
-
- io.servicetalk.concurrent.api.TestCompletable.Builder
-
- Enclosing class:
- TestCompletable
public static class TestCompletable.Builder extends java.lang.ObjectAllows for creatingTestCompletables with non-default settings. For defaults, see Defaults section of class javadoc.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
concurrentSubscribers
public TestCompletable.Builder concurrentSubscribers()
Allow concurrent subscribers. Default is to allow only sequential subscribers.- Returns:
- this.
- See Also:
ConcurrentCompletableSubscriberFunction
-
concurrentSubscribers
public TestCompletable.Builder concurrentSubscribers(ConcurrentCompletableSubscriberFunction function)
Allow concurrent subscribers, with the specifiedConcurrentCompletableSubscriberFunction. Default is to allow only sequential subscribers.- Parameters:
function- theConcurrentCompletableSubscriberFunctionto use.- Returns:
- this.
-
sequentialSubscribers
public TestCompletable.Builder sequentialSubscribers()
Allow sequential subscribers. This is the default.- Returns:
- this.
- See Also:
SequentialCompletableSubscriberFunction
-
sequentialSubscribers
public TestCompletable.Builder sequentialSubscribers(SequentialCompletableSubscriberFunction function)
Allow sequential subscribers, with the specifiedSequentialCompletableSubscriberFunction. This is the default.- Parameters:
function- theSequentialCompletableSubscriberFunctionto use.- Returns:
- this.
-
singleSubscriber
public TestCompletable.Builder singleSubscriber()
Allow only a single subscriber. Default is to allow sequential subscribers.- Returns:
- this.
- See Also:
NonResubscribeableCompletableSubscriberFunction
-
singleSubscriber
public TestCompletable.Builder singleSubscriber(NonResubscribeableCompletableSubscriberFunction function)
Allow only a single subscriber, with the specifiedNonResubscribeableCompletableSubscriberFunction. Default is to allow sequential subscribers.- Parameters:
function- theNonResubscribeableCompletableSubscriberFunctionto use.- Returns:
- this.
-
autoOnSubscribe
public TestCompletable.Builder autoOnSubscribe()
Enable callingCompletableSource.Subscriber.onSubscribe(Cancellable)automatically upon subscribe. The default is enabled.- Returns:
- this.
- See Also:
AutoOnSubscribeCompletableSubscriberFunction
-
autoOnSubscribe
public TestCompletable.Builder autoOnSubscribe(AutoOnSubscribeCompletableSubscriberFunction function)
Enable callingCompletableSource.Subscriber.onSubscribe(Cancellable)automatically upon subscribe, with the specifiedAutoOnSubscribeCompletableSubscriberFunction. The default is enabled.- Parameters:
function- theAutoOnSubscribeCompletableSubscriberFunctionto use.- Returns:
- this.
-
disableAutoOnSubscribe
public TestCompletable.Builder disableAutoOnSubscribe()
Disable callingCompletableSource.Subscriber.onSubscribe(Cancellable)automatically upon subscribe. The default is enabled.- Returns:
- this.
-
build
public TestCompletable build(java.util.function.Function<CompletableSource.Subscriber,CompletableSource.Subscriber> function)
Create aTestCompletableusing the specified subscriber function.All other settings from this
TestCompletable.Builderwill be ignored.- Parameters:
function- The subscriber function to use.- Returns:
- a new
TestCompletable.
-
build
public TestCompletable build()
Create aTestCompletableas configured by the builder.- Returns:
- a new
TestCompletable.
-
-