AsyncFunction

org.apache.flink.api.async.AsyncFunction
@PublicEvolving
trait AsyncFunction[IN, OUT] extends Function

A function to trigger async I/O operations.

For each asyncInvoke an async io operation can be triggered, and once it has been done, the result can be collected by calling ResultFuture.complete. For each async operation, its context is stored in the operator immediately after invoking asyncInvoke, avoiding blocking for each stream input as long as the internal buffer is not full.

ResultFuture can be passed into callbacks or futures to collect the result data. An error can also be propagate to the async IO operator by ResultFuture.completeExceptionally.

Attributes

IN

The type of the input element

OUT

The type of the output elements

Graph
Supertypes
trait Function
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
class RichAsyncFunction[IN, OUT]

Members list

Concise view

Value members

Abstract methods

def asyncInvoke(input: IN, resultFuture: ResultFuture[OUT]): Unit

Trigger the async operation for each stream input

Trigger the async operation for each stream input

Attributes

input

element coming from an upstream task

resultFuture

to be completed with the result data

Concrete methods

def timeout(input: IN, resultFuture: ResultFuture[OUT]): Unit

AsyncFunction.asyncInvoke timeout occurred. By default, the result future is exceptionally completed with a timeout exception.

AsyncFunction.asyncInvoke timeout occurred. By default, the result future is exceptionally completed with a timeout exception.

Attributes

input

element coming from an upstream task

resultFuture

to be completed with the result data