Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Alexandre Masselot
And one solution came def actorFlow = Action { val (ref, publisher) = Source.actorRef[String](10, fail).toMat(Sink.asPublisher(true))(Keep.both).run() ref ! "PAF" actorSystem.scheduler.scheduleOnce(1000 milliseconds, ref, "delayed PIF")

Re: [akka-user] Re: Exposing Akka actors through a REST API

2016-11-11 Thread Konrad Malawski
So my question is if there is some framework or library to easily do this mapping, from the REST end-points to the corresponding ActorRefs... I've seen people do that, however I'd argue it's a terrible anti-pattern to just "expose whatever internal state you have onto the HTTP APIs". It's like

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Alexandre Masselot
Hei Viktor, Sure. Sorry if it was not clear. My goal is to use SSE to feed an EventSource on JavaScript side. On the example given, the tick call correctly produces events on the line, but the actorFlow, none. The example below tries to be minimalist, but in the real play app, I have an actor

Re: [akka-user] StreamSupervisor name

2016-11-11 Thread Richard Rodseth
Thanks. I actually found the bug that was causing my stream to get stuck. I was running a Source.queue in an actor, and calling context.become (without stashing) immediately afterwards. I found that one of the stream elements was reaching the initial receive handler, and thus not getting acked.

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Viktor Klang
Hi Alexandre, perhaps if you describe what you are trying to do, then the readers can suggest different solutions which might fit the use case? On Fri, Nov 11, 2016 at 12:43 PM, Alexandre Masselot < alexandre.masse...@gmail.com> wrote: > > Thanks √ , > Your feedback makes real sense. But I'm

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Alexandre Masselot
Thanks √ , Your feedback makes real sense. But I'm nonetheless confused about how to make it work:) Alex On Friday, November 11, 2016 at 11:38:48 AM UTC+1, √ wrote: > > Because in your actor example you're confusing the materialization of one > flow with the returning of another. > > On Fri,

[akka-user] ANNOUNCE: Alpakka 0.1 Released - call to arms

2016-11-11 Thread Martynas Mickevičius
We believe that Akka Streams can be the tool for building a modern alternative to Apache Camel . That will not happen by itself overnight and this is a call for arms for the community to join us on this mission. We are excited to announce that the new Alpakka repository

Re: [akka-user] Re: Akka persistence query examples

2016-11-11 Thread Akka Team
One option would be to use a persistent actor as your read side as well, store the last offset you have seen and stream from after that offset when the actor has recovered completely, this way you can also provide snapshots (and possible delete the actor to replay the entire history into a view

Re: [akka-user] StreamSupervisor name

2016-11-11 Thread Akka Team
AbruptTerminationException happens when the actor running the stream (the "graph interpreter") is terminated without the stream first completing or failing, for example if terminating an actor system with a running stream in it. The paths of the supervisors are pretty much an implementation

[akka-user] Re: Exposing Akka actors through a REST API

2016-11-11 Thread Alvaro Santuy
Hi Matt. In this project we are going to use a DDD aproach using Persistent Actors to represent Aggregate Roots. So, in some way, each Actor will map to a REST resource: I don't mean that Actors were directly exposed, a supervisor could mediate fordwarding messages from the REST front-end to

Re: [akka-user] Server Sent Events with Play and Actor

2016-11-11 Thread Viktor Klang
Because in your actor example you're confusing the materialization of one flow with the returning of another. On Fri, Nov 11, 2016 at 11:29 AM, Alexandre Masselot < alexandre.masse...@gmail.com> wrote: > Hello, > > I'm a bit stuck and seeking for help;) > A play controller should be producing