Re: [akka-user] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread Viktor Klang
Hi Regis, unfortunately you're still doing unsafe things (you have a race-condition in your accesses to bufferedElement) On Fri, Oct 14, 2016 at 3:56 PM, regis leray wrote: > Thanks a lot i succeed, to make it work... > > val switch = new ValveSwitch { > val callback =

[akka-user] Issue regarding AddressFromURIString and DNS hostnames

2016-10-14 Thread 'Carl Pulley' via Akka User List
The following code generates a java.net.MalformedURLException: AddressFromURIString("akka.tcp://Example@node_1:2552”) Looking at the underlying implementation of AddressFromURIString, the exception derives from the use of java.net.URI to parse this string. Which in turn, correctly throws an

[akka-user] Implementation of Persistent Actor with initial state

2016-10-14 Thread Jakub Liska
Hey, what is the best practice to do in this hypothetical scenario : 1) Say you have a time series pipeline that started at 2014 and created persistent state on S3 and other DB systems 2) You can introspect these storages and know what partitions already exists in all of them 3) The persistent

Re: [akka-user] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread regis leray
Thanks a lot i succeed, to make it work... val switch = new ValveSwitch { val callback = getAsyncCallback[A](push(out, _)) override def open: Unit = { mode = ValveMode.Open bufferedElement.foreach(callback.invoke) bufferedElement = Option.empty } override def close: Unit = {

Re: [akka-user] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad Malawski
Have you read the blog post? In the async callback you can push(), that's what I meant. -- Konrad `ktoso` Malawski Akka @ Lightbend On 14 October 2016 at 10:11:09, Konrad 'ktoso' Malawski (ktos...@gmail.com) wrote: Please read this: -

Re: [akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread regis leray
Thanks a lot for your informations (and sorry for the double post). Can you please tell me what is the way to "wake up the stage", it is not really obvious how to make that happen. Thanks Le vendredi 14 octobre 2016 04:09:12 UTC-4, Konrad Malawski a écrit : > > Please read this: > -

Re: [akka-user] Re: Replaying journal events without actually recovering Actors?

2016-10-14 Thread Akka Team
Yup, that's one way to do it - cheers! On Thu, Oct 13, 2016 at 10:07 PM, Spencer Judge wrote: > I can answered my own question here. It pretty much just came down to my > lack of knowledge around the streams API, which I hadn't used yet. Changing > the test to this works

[akka-user] Re: Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad 'ktoso' Malawski
Please read this: - http://blog.akka.io/integrations/2016/08/29/connecting-existing-apis - and this: http://doc.akka.io/docs/akka/2.4/scala/stream/stream -customize.html Specifically, your trigger should be implemented as async-callback, as it comes from the outside but should "wake up" the

[akka-user] Re: Akka stream - Flow in Pause

2016-10-14 Thread Konrad 'ktoso' Malawski
Seems like double posted the same question? Please don't double post the same question :-) I answered in that thread: https://groups.google.com/forum/#!topic/akka-user/7VqlP1w_CN8 -- Konrad Akka Team W dniu piątek, 14 października 2016 09:02:59 UTC+2 użytkownik regis leray napisał: > > I'm

Re: [akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread Konrad Malawski
Please read this: - http://blog.akka.io/integrations/2016/08/29/connecting-existing-apis - and this: http://doc.akka.io/docs/akka/2.4/scala/stream/stream-customize.html Specifically, your trigger should be implemented as async-callback, as it comes from the outside but should "wake up" the stage

[akka-user] Akka stream - implements Pause/Resume

2016-10-14 Thread regis leray
Hi, Im currently trying to implement a valve Graph to manage pause/resume. We can control the behavior of the graph by using the MaterializeValue trait ValveSwitch { def open: Unit def close: Unit } Current implementation of the valve class Valve[A](mode: ValveMode = ValveMode.Open)

[akka-user] Re: Akka stream - Flow in Pause

2016-10-14 Thread regis leray
I'm trying to implement the pause/resume in akka stream. The current implementation, is buffering all elements into an List if the valve is in mode "close", if not we are pushing elements like the default behavior. When we are resuming the flow by calling the materialize value switch.open, we