T - the handled / event typepublic interface SubscriptionBuilder<T>
Subscription builder.| Modifier and Type | Field and Description |
|---|---|
static BiConsumer<Object,Throwable> |
DEFAULT_EXCEPTION_CONSUMER |
| Modifier and Type | Method and Description |
|---|---|
SubscriptionBuilder<T> |
expireAfter(long maxCalls)
Sets the number of calls until the handler will automatically be unregistered
|
SubscriptionBuilder<T> |
expireAfter(long duration,
TimeUnit unit)
Sets the expiry time on the handler
|
SubscriptionBuilder<T> |
expireIf(Predicate<T> predicate)
Add a expiry predicate.
|
SubscriptionBuilder<T> |
filter(Predicate<T> predicate)
Adds a filter to the handler.
|
static final BiConsumer<Object,Throwable> DEFAULT_EXCEPTION_CONSUMER
@Nonnull SubscriptionBuilder<T> expireIf(@Nonnull Predicate<T> predicate)
predicate - the expiry test@Nonnull SubscriptionBuilder<T> expireAfter(long duration, @Nonnull TimeUnit unit)
duration - the duration until expiryunit - the unit for the durationIllegalArgumentException - if duration is not greater than or equal to 1@Nonnull SubscriptionBuilder<T> expireAfter(long maxCalls)
The call counter is only incremented if the event call passes all filters and if the handler completes without throwing an exception.
maxCalls - the number of times the handler will be called until being unregistered.IllegalArgumentException - if maxCalls is not greater than or equal to 1Copyright © 2020. All rights reserved.