[akka-user] Re: akka-persistance - nested persist

2016-12-02 Thread Aditya Prasad
Now that nested persist works, is it still strongly suggested not to nest persists? The way I see it, there are a few approaches: 1. Nested persists. In this model, my handler does (a) applyEvent (state change) and (b) postApply (take action, including more persisting). This allows me

Re: [akka-user] probe does not get Terminated message

2016-09-16 Thread Aditya Prasad
Never mind. Somehow it started working. On Friday, September 16, 2016 at 2:13:21 PM UTC-7, Aditya Prasad wrote: > > D'oh, thanks! I went back and re-read the docs and now see that there's no > (easy) way to be notified on an Actor stop/restart. I'll roll my own &g

Re: [akka-user] probe does not get Terminated message

2016-09-16 Thread Aditya Prasad
t so it would be wrong to signal that it becomes > invalid (which is what Terminated means). > > Regards, > > Roland > > 16 sep. 2016 kl. 08:02 skrev Aditya Prasad >: > > Howdy y'all, > > I'm using a TestKit probe. It receives most messages just fine.

[akka-user] probe does not get Terminated message

2016-09-15 Thread Aditya Prasad
Howdy y'all, I'm using a TestKit probe. It receives most messages just fine. But somehow it's not noticing the termination of my actor: probe.watch(repActor) probe.expectTerminated(repActor, eventTimeout.plus(100.milliseconds)) I get: > [info] java.lang.AssertionError: assertion failed: e

Re: [akka-user] Re: leveldb readjournal eventsByPersistenceId hangs when toSequenceNr=0

2016-08-21 Thread Aditya Prasad
Ah, thanks. That seems to confirm another suspicion of mine (though perhaps it's documented somewhere): that journal numbers should start at 1, not 0(?) Nothing else, I think. -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/doc

Re: [akka-user] Re: leveldb readjournal eventsByPersistenceId hangs when toSequenceNr=0

2016-08-21 Thread Aditya Prasad
On Sun, Aug 21, 2016 at 9:10 AM, Aditya Prasad wrote: > Thanks Patrick. > Sorry... thanks *Patrik*. > What are the more general conditions under which the stream should > terminate? > > I've come to appreciate the behavior that the stream terminates once it >

Re: [akka-user] Re: leveldb readjournal eventsByPersistenceId hangs when toSequenceNr=0

2016-08-21 Thread Aditya Prasad
here and complete it. The TCK would be a great place to add tests for the toSequenceNr. Fixing the actual implementations would also be needed, of course. Thanks, Patrik On Sun, Aug 21, 2016 at 7:33 AM, Aditya Prasad wrote: > Does anyone know the expected semantics of eventsByPersistenceId when

[akka-user] Re: leveldb readjournal eventsByPersistenceId hangs when toSequenceNr=0

2016-08-20 Thread Aditya Prasad
, 2016 at 10:52:58 AM UTC-7, Aditya Prasad wrote: > > Can anyone else repro this? This future never completes: > > val fut = readJournal.eventsByPersistenceId(tenantId.value, 0, >> 0).runWith(Sink.head) >> val res = Await.result(fut, 10 seconds) > > >

[akka-user] leveldb readjournal eventsByPersistenceId hangs when toSequenceNr=0

2016-08-18 Thread Aditya Prasad
Can anyone else repro this? This future never completes: val fut = readJournal.eventsByPersistenceId(tenantId.value, 0, > 0).runWith(Sink.head) > val res = Await.result(fut, 10 seconds) -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >>

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

2016-08-05 Thread Aditya Prasad
For anyone interested: turns out it's an error in the doc. Closing the listening side is *not* supposed to close the sending side. On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote: > > Hi! > > I've got code like this: > >> val fl

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

2016-08-01 Thread Aditya Prasad
Filed an issue: https://github.com/akka/akka/issues/21089 On Monday, August 1, 2016 at 11:36:15 AM UTC-7, Aditya Prasad wrote: > > Hmm, I did, and that's why I'm asking this question :) It says: > > "The Akka HTTP WebSocket API does not support half-closed connections

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

2016-08-01 Thread Aditya Prasad
sed_WebSockets > > -- > Konrad `ktoso` Malawski > Akka <http://akka.io> @ Lightbend <http://lightbend.com> > > On 1 August 2016 at 20:17:56, Aditya Prasad (akpra...@gmail.com) wrote: > > tl;dr: webSocketClientFlow does not close the websocket (or shut down its >

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

2016-08-01 Thread Aditya Prasad
tl;dr: webSocketClientFlow does not close the websocket (or shut down its input stream) when the output stream ends, but I think it's supposed to. It *does* do the reverse (shut down the output when the input terminates). On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote: &

[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 = Prom

[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 u

Re: [akka-user] Akka Persistence - callback for persistAll when all events have been saved

2016-06-13 Thread Aditya Prasad
Right-o, thanks :) On Sat, Jun 11, 2016 at 8:30 AM, Patrik Nordwall wrote: > You need to pass something, but it can any object, e.g. a String that you > don't use. > > /Patrik > > lör 11 juni 2016 kl. 01:15 skrev Aditya Prasad : > >> Newb question: what

[akka-user] Newbie question: connecting to read journal in preStart

2016-06-10 Thread Aditya Prasad
override def preStart = { super.preStart val persistenceIdsSink = Sink.actorRef(self, MyViewActor.Protocol.PersistenceIdsComplete) val source: Source[MyId, NotUsed] = readJournal.allPersistenceIds().map(MyId.apply) source.runWith(persistenceIdsSink) } Is this a sensible pattern for wi

Re: [akka-user] Akka Persistence - callback for persistAll when all events have been saved

2016-06-10 Thread Aditya Prasad
Newb question: what if I don't have an event for the deferAsync() call? I just want to execute a block with the guarantee that it runs after persistAll() completes. On Sunday, February 28, 2016 at 7:20:47 AM UTC-8, Łukasz Gąsior wrote: > > Thanks! > I think that's exactly what I need, and now t