Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-25 Thread Sergey Sopin
Hi Rafał, Thanks a lot for your comments! You are right, it is a time to test them separately. I've read that blog posts, but I will do it again carefully. Thanks again. Regards, Sergey вторник, 25 октября 2016 г., 12:54:15 UTC+3 пользователь Rafał Krzewski написал: > > Sergey, I spent a few

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-25 Thread Rafał Krzewski
Sergey, I spent a few minutes looking at your code, and I see two problems: -inletNumberToPullFrom is not scoped properly. It should be local to GraphLogic implementation. In the current form, it is shared between all ManagementFlow instances that get materialized that is definitely not what

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-24 Thread Sergey Sopin
Hi Rafał, - sink requests data from you > - OutletHandler.onPull is invoked on the outlet where the sink is > connected to > - you propagate demand outstream by calling pull on any (or all) of your > Inlets, depending on your logic > - eventually data becomes available upstream > -

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-20 Thread Rafał Krzewski
W dniu czwartek, 20 października 2016 20:28:26 UTC+2 użytkownik Sergey Sopin napisał: > > Rafał, > > - If I understand onPulI() function correctly, it is allowed only for > outlets, so in order to pull something you need to push it in this outlet > firstly. > > Here's how I understand how this

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-20 Thread Sergey Sopin
Rafał, - If I understand onPulI() function correctly, it is allowed only for outlets, so in order to pull something you need to push it in this outlet firstly. - Balancer has been taken from the docs: Balancing_jobs_to_a_fixed_pool_of_workers

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-20 Thread Rafał Krzewski
Sergey, I have a few remarks after cursory reading of your code: - Akka Streams (and Reactrive Streams) are pull based. As the messages travel downstream, virtual demand tokens travel upstream. Each graph element is allowed to push elements downstream only when demand is signaled. This means

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Sergey Sopin
Hi Rafał, Code that uses my shape is following: private CompletionStage buildAndRunGraph(ArrayList sourceList) { //First function Source source = Source.from(sourceList); Materializer materializer = ActorMaterializer.create(context());

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Rafał Krzewski
Sergey, you haven't shown any code related to passing messages yet, so it's impossible to guess what's happening at this point. As I said in previous message, the critical things are the actual components you put *inside* of your graph. The shapes just determine external connectors. Cheers,

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Sergey Sopin
Yep, I was trying to make something like that, but my code doesn't work. Messages stuck somewhere and I don't know how to fix it due to lack of Scala knowledge. You can find the code in my initial message here. I took UniformFanOut as example and unsuccessfully tried to replace single Inlet

Re: [akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Konrad Malawski
Shapes don't need separate java or scala api, it's shared. You can just subclass a shape and make a class that directly represents your shape. If you want AmorphousShape then sure, but please note that it's purpose is to "forget about the types of those". If you want a well typed one simply

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-19 Thread Sergey Sopin
Hi, Yes, but it seems that I need to create Java API for it, because my app is in Java. I used Inkscape app. to draw the diagram. Cheers, Sergey среда, 19 октября 2016 г., 0:46:00 UTC+3 пользователь Rafał Krzewski написал: > > A custom GraphStage [1] using AmorphousShape is probably the way

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-18 Thread Rafał Krzewski
A custom GraphStage [1] using AmorphousShape is probably the way to go in this case. That's a really neat diagram, BTW! What software did you us to create it? Cheers, Rafał [1] http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html#Custom_processing_with_GraphStage W dniu

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-18 Thread Sergey Sopin
Hi again, I have a very specific case. My flow looks like this one: The idea of multi input/output shape was to redirect messages to a right output based on the message

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-18 Thread Sergey Sopin
Hi, Rafał! Thanks a lot! You gave me everything I need :) I was looking for AmorphousShape! Thanks again, I will not be inventing a wheel anymore! Regards, Sergey вторник, 18 октября 2016 г., 18:34:22 UTC+3 пользователь Rafał Krzewski написал: > > It's not clear to me, what are you trying

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-18 Thread Rafał Krzewski
It's not clear to me, what are you trying to accomplish. It looks like you are trying to implement AmorphousShape (ie. arbitrary number of open inlets and outlets) on your own, and then a specific variant of it, that has all inlets sharing the same type, and all outlets sharing another type.

[akka-user] Re: [akka-stream] Problems with the shape creation

2016-10-18 Thread Sergey Sopin
People say that following article may help: http://degoes.net/articles/insufficiently-polymorphic However, I still don't understand what's wrong with it. Any help will be appreciated. Thanks! Regards, Sergey -- >> Read the docs: http://akka.io/docs/ >> Check the