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.Object
Allows for creatingTestCompletable
s 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
- theConcurrentCompletableSubscriberFunction
to 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
- theSequentialCompletableSubscriberFunction
to 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
- theNonResubscribeableCompletableSubscriberFunction
to 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
- theAutoOnSubscribeCompletableSubscriberFunction
to 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 aTestCompletable
using the specified subscriber function.All other settings from this
TestCompletable.Builder
will be ignored.- Parameters:
function
- The subscriber function to use.- Returns:
- a new
TestCompletable
.
-
build
public TestCompletable build()
Create aTestCompletable
as configured by the builder.- Returns:
- a new
TestCompletable
.
-
-