Flink's AsyncFunction is meant for enriching a record with information that needs to be queried externally. So I guess you can't use it for your use case because an async call is initiated by the input. However, your custom SourceFunction could implement a similar asynchronous logic. By having a pool of open connections that request asynchronously and emit the response to the stream, once available, you can improve your throughput (see ).
Depending on your use case maybe the SourceFunction can only be responsible for determining e.g. ids and the AsyncFunction is requesting these ids via REST. This way you could leverage the available async capabilities.
I hope this helps.
Am 14.05.18 um 14:51 schrieb Federico D'Ambrosio: