Flow API tools for working with cold observables

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

Flow API tools for working with cold observables

Pavel Rappo
Hi,

I wonder if there are any plans on creating some intermediary working between a
publisher and a subscriber that would take care of buffering? I believe it might
become a common need for Flow API adopters as it seems to represent a highly
reusable component. As I understand, j.u.c.SubmissionPublisher is not
particularly good for working with "cold" observables. It provides buffering but
for a different reason and it also relies on "drop handling and/or blocking" for
flow control. I don't think any of these options are particularly good when
working with cold observables in a non-blocking fashion.

What is needed in its essence is a some kind of "elastic coupling" working
between 2 subscribers that effectively manages a steady flow of items
prefetching them (if stock drops below some level) from the input side and
transferring them to the output side.

-Pavel
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Flow API tools for working with cold observables

Dávid Karnok
Popular reactive libraries have converters / ports to j.u.c.Flow already so you have the option to work with a plethora of operators over cold sources:





2016-02-24 12:29 GMT+01:00 Pavel Rappo <[hidden email]>:
Hi,

I wonder if there are any plans on creating some intermediary working between a
publisher and a subscriber that would take care of buffering? I believe it might
become a common need for Flow API adopters as it seems to represent a highly
reusable component. As I understand, j.u.c.SubmissionPublisher is not
particularly good for working with "cold" observables. It provides buffering but
for a different reason and it also relies on "drop handling and/or blocking" for
flow control. I don't think any of these options are particularly good when
working with cold observables in a non-blocking fashion.

What is needed in its essence is a some kind of "elastic coupling" working
between 2 subscribers that effectively manages a steady flow of items
prefetching them (if stock drops below some level) from the input side and
transferring them to the output side.

-Pavel
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



--
Best regards,
David Karnok

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Flow API tools for working with cold observables

Pavel Rappo
Thanks Dávid, I don't have a luxury of using 3rd party libraries. I
wonder what would others say? Is the "coupling" I've described is
essential enough to become a part of Flow API along with
SubmissionPublisher or I am missing something and it could *easily* be
assembled from already existing java.util.concurrent objects?

-Pavel

On Wed, Feb 24, 2016 at 11:48 AM, Dávid Karnok <[hidden email]> wrote:

> Popular reactive libraries have converters / ports to j.u.c.Flow already so
> you have the option to work with a plethora of operators over cold sources:
>
> https://github.com/akarnokd/RxJavaUtilConcurrentFlow
> https://github.com/reactor/reactor-core/blob/master/src/main/java/reactor/core/converter/FlowPublisherConverter.java
>
>
>
>
> 2016-02-24 12:29 GMT+01:00 Pavel Rappo <[hidden email]>:
>>
>> Hi,
>>
>> I wonder if there are any plans on creating some intermediary working
>> between a
>> publisher and a subscriber that would take care of buffering? I believe it
>> might
>> become a common need for Flow API adopters as it seems to represent a
>> highly
>> reusable component. As I understand, j.u.c.SubmissionPublisher is not
>> particularly good for working with "cold" observables. It provides
>> buffering but
>> for a different reason and it also relies on "drop handling and/or
>> blocking" for
>> flow control. I don't think any of these options are particularly good
>> when
>> working with cold observables in a non-blocking fashion.
>>
>> What is needed in its essence is a some kind of "elastic coupling" working
>> between 2 subscribers that effectively manages a steady flow of items
>> prefetching them (if stock drops below some level) from the input side and
>> transferring them to the output side.
>>
>> -Pavel
>> _______________________________________________
>> Concurrency-interest mailing list
>> [hidden email]
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
>
>
> --
> Best regards,
> David Karnok

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Flow API tools for working with cold observables

Viktor Klang
Implementing a `Processor` is non-trivial, and also depends on what semantics it is expected to have (i.e. does it support fan-out, i.e. multiple Subscribers or not).

If/When the JDK also gets Flow integration with existing NIO APIs I'd expect it to need to at the very least create some internal constructs to handle your use-case.

On Wed, Feb 24, 2016 at 5:47 PM, Pavel Rappo <[hidden email]> wrote:
Thanks Dávid, I don't have a luxury of using 3rd party libraries. I
wonder what would others say? Is the "coupling" I've described is
essential enough to become a part of Flow API along with
SubmissionPublisher or I am missing something and it could *easily* be
assembled from already existing java.util.concurrent objects?

-Pavel

On Wed, Feb 24, 2016 at 11:48 AM, Dávid Karnok <[hidden email]> wrote:
> Popular reactive libraries have converters / ports to j.u.c.Flow already so
> you have the option to work with a plethora of operators over cold sources:
>
> https://github.com/akarnokd/RxJavaUtilConcurrentFlow
> https://github.com/reactor/reactor-core/blob/master/src/main/java/reactor/core/converter/FlowPublisherConverter.java
>
>
>
>
> 2016-02-24 12:29 GMT+01:00 Pavel Rappo <[hidden email]>:
>>
>> Hi,
>>
>> I wonder if there are any plans on creating some intermediary working
>> between a
>> publisher and a subscriber that would take care of buffering? I believe it
>> might
>> become a common need for Flow API adopters as it seems to represent a
>> highly
>> reusable component. As I understand, j.u.c.SubmissionPublisher is not
>> particularly good for working with "cold" observables. It provides
>> buffering but
>> for a different reason and it also relies on "drop handling and/or
>> blocking" for
>> flow control. I don't think any of these options are particularly good
>> when
>> working with cold observables in a non-blocking fashion.
>>
>> What is needed in its essence is a some kind of "elastic coupling" working
>> between 2 subscribers that effectively manages a steady flow of items
>> prefetching them (if stock drops below some level) from the input side and
>> transferring them to the output side.
>>
>> -Pavel
>> _______________________________________________
>> Concurrency-interest mailing list
>> [hidden email]
>> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
>
>
> --
> Best regards,
> David Karnok

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest



--
Cheers,

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://cs.oswego.edu/mailman/listinfo/concurrency-interest