nokia / akka-typed-persistence Goto Github PK
View Code? Open in Web Editor NEWEvent sourcing for Akka Typed
License: Apache License 2.0
Event sourcing for Akka Typed
License: Apache License 2.0
We only use Task
from FS2. We should use cats.effect.IO
instead.
It would be nice to get access to the sequenceNr from within the actor. I have a process that depends on replaying at a certain event and knowing the seqNr is the best way to achieve that, also it seems like it would be useful for others.
Thoughts?
Why not make allow the Update function have access to the context as well?
For instance in this example,
implicit val parentUpdater: Update[ParentState, at.ActorRef[Mesg]] =
Update.instance((_, e, ctx) => e match {
case Uninitialized =>
val childRef = child(pid).deployInto(ctx.ctx)
Initialized(childRef)
}
...
case Uninitialized =>
ctx.apply(childRef, sync = true)
API changes will be necessary (due to API changes in Akka Typed).
Any chance you'd accept an upgrade to cats 0.8? It's mainly just replacing the Xor
construct with Either
Neat library!
Is there an example spawning a child actor somewhere? I seem to be running into trouble with it, I am using the ctx.ctx.spawn
facility:
[ERROR] [12/20/2016 14:32:09.070] [pingSystem-akka.actor.default-dispatcher-4] [akka://pingSystem/user/pingActor/$a] Wrap.message called with CheckZipStart(SessionId(272c5c45-9269-434c-a94c-893bc91bb815),94110,1482273129041,Actor[akka://pingSystem/system/testActor-1#496883580]); maybe the persistent typed behavior was deployed as a regular actor?
java.lang.IllegalStateException: Wrap.message called with CheckZipStart(SessionId(272c5c45-9269-434c-a94c-893bc91bb815),94110,1482273129041,Actor[akka://pingSystem/system/testActor-1#496883580]); maybe the persistent typed behavior was deployed as a regular actor?
at com.nokia.ntp.ct.persistence.package$.impossible(package.scala:96)
at com.nokia.ntp.ct.persistence.PersistentBehavior$Wrap.message(persistentBehavior.scala:110)
at akka.typed.adapter.ActorAdapter$$anonfun$receive$1.applyOrElse(ActorAdapter.scala:32)
at akka.actor.Actor$class.aroundReceive(Actor.scala:484)
at akka.typed.adapter.ActorAdapter.aroundReceive(ActorAdapter.scala:9)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)
at akka.actor.ActorCell.invoke(ActorCell.scala:495)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)
at akka.dispatch.Mailbox.run(Mailbox.scala:224)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Is there a way to replace behavior like there is in normal akka-typed, similar to this blog post?
If possible, we should create a method on PersistenceApi
like this:
def fromFuture[A](f: Future[A], sync: Boolean = false): Proc[A]
The hard part seems to be, that when sync
is true
, no messages should be delivered until the Future
finishes. (Also, maybe we'd need a timeout too, in case the Future
never finishes.)
The use case for this is described here: https://gitter.im/nokia/akka-typed-persistence?at=5980c287f5b3458e30a0138e
Would you be interested in setting up a gitter channel?
I am using this all and it's working great so far.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.