[akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-07-29 Thread Aditya Prasad
And just for kicks, here's my custom version of fromSinkAndSource that propagates stream termination. It's cobbled together from Akka code: def fromSinkAndSource[I, O](sink: Graph[SinkShape[I], _], source: Graph[SourceShape[O], _]): Flow[I, O, Unit] = { val p1 = Promise[Unit]() val p2 =

[akka-user] Websockets and Flow.fromSinkAndSource

2016-07-29 Thread Aditya Prasad
Hi! I've got code like this: > val flow = Http().webSocketClientFlow(WebSocketRequest(s"ws://..."))) > val sink = Sink.actorRef(actor, EventsComplete) > Source.tick[Message](KeepAliveDelay, KeepAliveDelay, > KeepAlive).via(flow).runWith(sink) The Source.tick is there because if I

[akka-user] Weakly up feature not working

2016-07-29 Thread Tom Pantelis
Hello, I enabled weakly-up in the akka.conf as documented: akka.cluster.allow-weakly-up-members = on, and subscribed for MemberWeaklyUp events. I have a 3-node cluster. I stopped 2 of the nodes, node2 and node3, and restarted node2. It's my understanding that.with allow-weakly-up-members

[akka-user] [akka-stream] How to emit the newest element every n seconds?

2016-07-29 Thread Dominykas Mostauskis
In Akka Stream, I'd like a stream with a timer that emits an element every n seconds. The timer should emit from a 1 element buffer that drops head on overflow (meaning only keeps the newest element). So essentially emit the newest element in intervals of n seconds. How can this be done? My

Re: [akka-user] Why isn't akka PersistenceQuery using the Event Adapter configuration?

2016-07-29 Thread Konrad Malawski
I believe this was by design actually if I remember correctly, as we considered the read side may want to operate on the raw events by default. Let's say that in the same app that needs adapters for the PersistentActors you want to project a view from historical data, thus you may not want to

[akka-user] Cannot start Source.Queue inside a trait

2016-07-29 Thread Lap Ming Lee
I notice that when I define Source.Queue inside a trait that will be *mixedin* with other traits it will throw an exception. But if Source.Queue is defined in the implementation class, it works fine. Is this suppose to be the correct behavior? trait Requests extends Actor with ActorLogging