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 topicpublic final class AsyncResult<D,K,O,R> extends Object
R
, and
save it to an output topic.Modifier and Type | Field and Description |
---|---|
java.util.function.Function<D,K> |
keyMapper
The Key mapper converts the decoded input type to a key for the output topic.
|
java.util.function.Function<O,Optional<io.simplesource.data.Result<Throwable,R>>> |
outputMapper
A function that takes the output of the async invocation and decodes it / converts it to the required result type.
|
TopicSerdes<K,R> |
outputSerdes
The serdes for writing the result to the output topic.
|
Constructor and Description |
---|
AsyncResult() |
public final java.util.function.Function<O,Optional<io.simplesource.data.Result<Throwable,R>>> outputMapper
For example, the async function may be a call to a web service that returns a Json payload.
This function is then be used to convert the Json to the desired result type R
.
public final java.util.function.Function<D,K> keyMapper
public final TopicSerdes<K,R> outputSerdes
Copyright © 2019. All rights reserved.