Class RateLimiter<T>
java.lang.Object
io.activej.reactor.AbstractReactive
io.activej.reactor.ImplicitlyReactive
io.activej.csp.process.AbstractCommunicatingProcess
io.activej.csp.process.transformer.AbstractChannelTransformer<RateLimiter<T>,T,T>
io.activej.csp.process.transformer.impl.RateLimiter<T>
- All Implemented Interfaces:
io.activej.async.process.AsyncCloseable,io.activej.async.process.ReactiveProcess,HasChannelInput<T>,HasChannelOutput<T>,WithChannelInput<RateLimiter<T>,,T> WithChannelOutput<RateLimiter<T>,,T> WithChannelTransformer<RateLimiter<T>,,T, T> ChannelConsumerTransformer<T,,ChannelConsumer<T>> ChannelSupplierTransformer<T,,ChannelSupplier<T>> ChannelTransformer<T,,T> io.activej.reactor.Reactive
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classstatic interfaceNested classes/interfaces inherited from class io.activej.csp.process.AbstractCommunicatingProcess
AbstractCommunicatingProcess.SanitizedBinaryChannelSupplier -
Field Summary
FieldsModifier and TypeFieldDescriptionlongfinal double@Nullable io.activej.reactor.schedule.ScheduledRunnabledoubleFields inherited from class io.activej.csp.process.transformer.AbstractChannelTransformer
input, outputFields inherited from class io.activej.reactor.AbstractReactive
reactorFields inherited from interface io.activej.async.process.AsyncCloseable
STATIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> RateLimiter<T>.Builderbuilder(double refillRate, ChronoUnit perUnit) static <T> RateLimiter<T>create(double refillRate, ChronoUnit perUnit) protected voidprotected io.activej.promise.Promise<Void>Methods inherited from class io.activej.csp.process.transformer.AbstractChannelTransformer
beforeProcess, doClose, doProcess, getInput, getOutput, onProcessFinish, onProcessStart, send, sendEndOfStreamMethods inherited from class io.activej.csp.process.AbstractCommunicatingProcess
afterProcess, close, closeEx, completeProcess, completeProcessEx, doSanitize, getProcessCompletion, isProcessComplete, isProcessStarted, sanitize, sanitize, sanitize, sanitize, startProcessMethods inherited from class io.activej.reactor.AbstractReactive
getReactorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.reactor.Reactive
getReactorMethods inherited from interface io.activej.csp.dsl.WithChannelInput
withInputMethods inherited from interface io.activej.csp.dsl.WithChannelOutput
withOutputMethods inherited from interface io.activej.csp.dsl.WithChannelTransformer
transform, transform
-
Field Details
-
refillRatePerMillis
public final double refillRatePerMillis -
tokens
public double tokens -
lastRefillTimestamp
public long lastRefillTimestamp -
tokenizer
-
scheduledRunnable
@Nullable public @Nullable io.activej.reactor.schedule.ScheduledRunnable scheduledRunnable
-
-
Constructor Details
-
RateLimiter
public RateLimiter(double refillRatePerMillis)
-
-
Method Details
-
create
-
builder
-
onItem
- Specified by:
onItemin classAbstractChannelTransformer<RateLimiter<T>,T, T>
-
onCleanup
protected void onCleanup()- Overrides:
onCleanupin classAbstractChannelTransformer<RateLimiter<T>,T, T>
-