flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Pryakhin <m.prya...@gmail.com>
Subject RichAsyncFunction Timer Service
Date Fri, 19 Apr 2019 15:41:59 GMT
Hello, Flink community!

It happens that I need to access a timer service in a RichAsyncFunction implementation. I
know it's normally accomplished via StreamingRuntimeContext instance available in a RichFunction,
but unfortunately, RichAsyncFunction extending RichFunction overrides “setRuntimeContext”
method [1] wrapping a RuntimeContext instance passed as the method argument into a RichAsyncFunctionRuntimeContext
instance [2]. This RichAsyncFunction specific RuntimeContext implementation is private [2]
which makes it infeasible to gain access to a wrapped original RuntimeContext thus making
it impossible to leverage timer service in RichAsyncFunction implementations. Just curious
is there any reason for that? Can we make this implementation public or somehow share a wrapped

Many thanks in advance!

[1] https://github.com/apache/flink/blob/c96a4d7afe379a291cc538ca36af896df8dc2127/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/RichAsyncFunction.java#L76
[2] https://github.com/apache/flink/blob/c96a4d7afe379a291cc538ca36af896df8dc2127/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/RichAsyncFunction.java#L100

Kind Regards,
Mike Pryakhin

View raw message