public final class AsyncBuilder extends Object
An async action is an action that executes an arbitrary asynchronous function in a saga. The result of the function can be optionally piped to an output topic.
This build step:
Constructor and Description |
---|
AsyncBuilder() |
Modifier and Type | Method and Description |
---|---|
static <A,D,K,O,R> |
apply(AsyncSpec<A,D,K,O,R> spec) |
static <A,D,K,O,R> |
apply(AsyncSpec<A,D,K,O,R> spec,
ScheduledExecutorService executor) |
static <A,D,K,O,R> |
apply(AsyncSpec<A,D,K,O,R> spec,
TopicConfigBuilder.BuildSteps topicBuildFn) |
static <A,D,K,O,R> |
apply(AsyncSpec<A,D,K,O,R> spec,
TopicConfigBuilder.BuildSteps topicBuildFn,
ScheduledExecutorService executor) |
public static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(AsyncSpec<A,D,K,O,R> spec, TopicConfigBuilder.BuildSteps topicBuildFn, ScheduledExecutorService executor)
A
- common representation form for all action commands (typically Json or GenericRecord/SpecificRecord for Avro)D
- intermediate decoded input typeK
- key for the output topic (if the result of async invocation is written to an output topic)O
- output value returned by async functionR
- final result type that ends up in output topicspec
- a data structure with all the details required to set up the async invocation and process the resultstopicBuildFn
- a functional interface representing topic configuration stepsexecutor
- the executor service that is used to invoke asynchronously and schedule timeoutspublic static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(AsyncSpec<A,D,K,O,R> spec, TopicConfigBuilder.BuildSteps topicBuildFn)
public static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(AsyncSpec<A,D,K,O,R> spec)
public static <A,D,K,O,R> ActionProcessorBuildStep<A> apply(AsyncSpec<A,D,K,O,R> spec, ScheduledExecutorService executor)
Copyright © 2019. All rights reserved.