Class FireForgetProcessor<T>
java.lang.Object
com.helixframework.concurrency.processor.FireForgetProcessor<T>
- Type Parameters:
T- event type
- All Implemented Interfaces:
ShutdownBehaviorAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public abstract class FireForgetProcessor<T>
extends Object
implements org.springframework.context.SmartLifecycle, ShutdownBehaviorAware
Abstract processor that can be used to implement async fire and forget messaging.
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofFireForgetProcessor.FireForgetProcessor(int capacity) Creates a new instance ofFireForgetProcessor.FireForgetProcessor(int capacity, Duration timeout) Creates a new instance ofFireForgetProcessor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helixframework.concurrency.processor.ShutdownBehaviorAware
getShutdownBehaviorMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup
-
Constructor Details
-
FireForgetProcessor
public FireForgetProcessor()Creates a new instance ofFireForgetProcessor. -
FireForgetProcessor
public FireForgetProcessor(int capacity) Creates a new instance ofFireForgetProcessor.- Parameters:
capacity- capacity of processor before events are dropped
-
FireForgetProcessor
Creates a new instance ofFireForgetProcessor.- Parameters:
capacity- capacity of processor before events are droppedtimeout- timeout on event submit before event is dropped
-
-
Method Details
-
submit
Submits an event to the processor.- Parameters:
input- event
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getName
Gets the name of this processor.- Returns:
- name
-
consumer
Gets the consumer function that will consume events sent to this processor.- Returns:
- event consumer
-