Rich variant for Async IO in Scala

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

Rich variant for Async IO in Scala

Bruno Aranda
Hi,

I see that the AsyncFunction for Scala does not seem to have a rich variant like the Java one. Is there a particular reason for this? Is there any workaround?

Thanks!

Bruno
Reply | Threaded
Open this post in threaded view
|

Re: Rich variant for Async IO in Scala

Timo Walther
Hi Bruno,

`org.apache.flink.streaming.api.functions.async.RichAsyncFunction`
should also work for the Scala API. `RichMapFunction` or
`RichFilterFunction` are also shared between both APIs.

Is there anything that blocks you from using it?

Regards,
Timo

Am 09.11.18 um 01:38 schrieb Bruno Aranda:
> Hi,
>
> I see that the AsyncFunction for Scala does not seem to have a rich
> variant like the Java one. Is there a particular reason for this? Is
> there any workaround?
>
> Thanks!
>
> Bruno


Reply | Threaded
Open this post in threaded view
|

Re: Rich variant for Async IO in Scala

Bruno Aranda
Hi,

Tried again last night. The problem is that I was trying to use org.apache.flink.streaming.api.scala.AsyncDataStream, and that won't compile against the RichAsyncFunction. I could change it to use  org.apache.flink.streaming.api.datastream.AsyncDataStream instead, but it is not as elegant as it requires the result to be a Java collection. But it works.

Thanks!

Bruno

On Mon, 12 Nov 2018 at 16:43 Timo Walther <[hidden email]> wrote:
Hi Bruno,

`org.apache.flink.streaming.api.functions.async.RichAsyncFunction`
should also work for the Scala API. `RichMapFunction` or
`RichFilterFunction` are also shared between both APIs.

Is there anything that blocks you from using it?

Regards,
Timo

Am 09.11.18 um 01:38 schrieb Bruno Aranda:
> Hi,
>
> I see that the AsyncFunction for Scala does not seem to have a rich
> variant like the Java one. Is there a particular reason for this? Is
> there any workaround?
>
> Thanks!
>
> Bruno


Reply | Threaded
Open this post in threaded view
|

Re: Rich variant for Async IO in Scala

Timo Walther
It should compile against a RichAsyncFunction as well. Can you open an issue on JIRA for this? Including the compiler issues that you observe.

Thank you.

Am 13.11.18 um 15:40 schrieb Bruno Aranda:
Hi,

Tried again last night. The problem is that I was trying to use org.apache.flink.streaming.api.scala.AsyncDataStream, and that won't compile against the RichAsyncFunction. I could change it to use  org.apache.flink.streaming.api.datastream.AsyncDataStream instead, but it is not as elegant as it requires the result to be a Java collection. But it works.

Thanks!

Bruno

On Mon, 12 Nov 2018 at 16:43 Timo Walther <[hidden email]> wrote:
Hi Bruno,

`org.apache.flink.streaming.api.functions.async.RichAsyncFunction`
should also work for the Scala API. `RichMapFunction` or
`RichFilterFunction` are also shared between both APIs.

Is there anything that blocks you from using it?

Regards,
Timo

Am 09.11.18 um 01:38 schrieb Bruno Aranda:
> Hi,
>
> I see that the AsyncFunction for Scala does not seem to have a rich
> variant like the Java one. Is there a particular reason for this? Is
> there any workaround?
>
> Thanks!
>
> Bruno