Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread David Pinn
The JavaDoc for the Source.from(...) method says this: Elements are emitted periodically with the specified interval. The tick element will be delivered to downstream consumers that has requested any elements. If a consumer has not requested any elements at the point in time when the tick

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread Viktor Klang
There is no stream cancellation, there is only erronous or normal completion. What does the java/scaladoc say? -- Cheers, √ On 26 Jul 2015 09:17, David Pinn dp...@byandlarge.net wrote: No, but I might try to put one together. When the tick source is cancelled, should that cause cancellation

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread David Pinn
Yes, that's what I'm doing. More precisely, I'm defining a composite Source like so: Initial ~ Merge ~ Akka HTTP ~ Broadcast ~ Consumer +~ ~+ | | +~~~ Throttler ~~+ The

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread Rafał Krzewski
David, does your flow contain an actual internal feedback loop? What I understand from your description is that you have something like this: { tick source ~ mapAsync calling external service ~ } ~ consumer And your return the Cancellable provided by the tick source as materialized value as

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread David Pinn
No, but I might try to put one together. When the tick source is cancelled, should that cause cancellation of the stream, or completion of the stream? -- Read the docs: http://akka.io/docs/ Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html Search the

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread David Pinn
I've created a test that exercises a composite source that has an internal cycle. It processes integers, starting at 1 and doubling it until it is cancelled. The code can be viewed as a gist https://gist.github.com/dpinn/cdac6709e00b7de64163. Two things to note: a) the stream completes

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread Rafał Krzewski
Since we have √'s attention, allow me to repeat my original question: The question now remains, how do I fabricate a Graph[FlowShape[T, T], Cancellable] that will generate an instance of Cancellable on each materialization connected to a PushPullStage, in such way that cancel() would

[akka-user] Re: Best practice for nested flows and graphs

2015-07-26 Thread Raam Rosh-Hai
I would really appreciate any tips for the correct direction On Thursday, July 23, 2015 at 3:02:54 PM UTC+3, ra...@qmerce.com wrote: I am implementing a simple http server which listens to requests and persists them to Cassandra. I have to split the stream in two using Broadcast so I am

[akka-user] How do I mix typed and untyped actors?

2015-07-26 Thread Jack Daniels
How do I mix typed and untyped actors ? As I understood I have to specify main actor when I create instance of ActorSystem like this val system: akka.typed.ActorSystem[Start] = akka.typed.ActorSystem(main, Props(mainBehaviour)) On the other hand I use akka-http which is initialized like

[akka-user] [akka-streams] Consuming on TCP server side - is this really the best way?

2015-07-26 Thread Derek Wyatt
Hi, I'm still trying to figure out the best way to work with TCP flows and, while I've got something working, this seems really quite wrong, so there's gotta be a better way. What I want to do is send an Iterable[Int] from the client to the server and have the server materialize that

[akka-user] [Remoting] Akka Actor Refs Can be Called from another Node?

2015-07-26 Thread kraythe
Greetings, I am working on some tech to integrate hazelcast and Akka. The thing is with Hazelcast, a particular object in the cache may be on any one of the nodes in the cluster and serializing the object from its host node to the node in the cluster where it is being processed can be

[akka-user] Re: Play + Akka Cluster Aware Routing?

2015-07-26 Thread kraythe
So is the strategy I laid out flawed? I don't want to be accessing objects on the wrong node, that's a critical element of the dynamic. getting Akka and play to cooperate in cluster is not that hard. I want to make intelligent routing decisions. -- Read the docs: http://akka.io/docs/

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread David Pinn
I think this could happen if a stage immediately requests the next element once it starts working on a received element. Is that the case? On Sunday, 26 July 2015 23:39:00 UTC+10, David Pinn wrote: b) the stream processes one more element than I expect it to. The source under test spits out

Re: [akka-user] Re: streams - shutting down a flow / exposing a materialized value

2015-07-26 Thread Viktor Klang
Requesting one element at a time would lead to low-to-no concurrency and high overhead per element. Check input buffer size in Attributes. -- Cheers, √ On 26 Jul 2015 17:50, David Pinn dp...@byandlarge.net wrote: I think this could happen if a stage immediately requests the next element once