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 =

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: -