Is there a way to start a timer without ever receiving an event?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to start a timer without ever receiving an event?

Marco Villalobos-2
In the Stream API KeyedProcessFunction,is there a way to start a timer without ever receiving a stream event?
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to start a timer without ever receiving an event?

Andrey Zagrebin-5
I do not think so. Each timer in KeyedProcessFunction is associated with the key. The key is implicitly set into the context from the record which is currently being processed.

On Wed, Aug 12, 2020 at 8:00 AM Marco Villalobos <[hidden email]> wrote:
In the Stream API KeyedProcessFunction,is there a way to start a timer without ever receiving a stream event?
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to start a timer without ever receiving an event?

Timo Walther
What you can do is creating an initial control stream e.g. using
`StreamExecutionEnivronment.fromElements()` and either use
`union(controlStream, actualStream)` or use
`actualStream.connect(controlStream)`.

Regards,
Timo


On 12.08.20 18:15, Andrey Zagrebin wrote:

> I do not think so. Each timer in KeyedProcessFunction is associated with
> the key. The key is implicitly set into the context from the record
> which is currently being processed.
>
> On Wed, Aug 12, 2020 at 8:00 AM Marco Villalobos
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     In the Stream API KeyedProcessFunction,is there a way to start a
>     timer without ever receiving a stream event?
>