These are chat archives for akkadotnet/akka.net
Context.System.Scheduler. Because i want registrations on the scheduler to survive process restarts. Is there anything in the akka.persistence module for this?
@Danthar there's not such thing. @rogeralsing also was asking for that not so long ago.
I think, that the best way to do that is to create custom extension, which will run persistent schedule recorder actor when applied to actor system. From there classic event sourcing should be sufficient (just remember that schedule cancelations and ack's also may be necessary to persist)
system.PersistentSchedulerthat just acts as a facade over the persistent actor. not sure if it would make sense to have all the same scheduler methods, some might be impossible to use on restart, e.g. cancellation and such
@rogeralsing this is from @lepinay
Hello, I've been trying to test the fix akkadotnet/akka.net#999 on the dev branch using this fsharp script https://gist.github.com/lepinay/d90c20e27e615d7f2642 , So before the fix we had a serialization exception, after the fix the exception is gone but the message is never received neither on the remote actor. Would be nice if someone could have a look at the gist before I raise a bug. I'm thinking maybe I got the hocon wrong ?
Akka.Testing.NUnit.TestKitthat allows isolation of test methods? I'm getting assertion fails and errors in my tests because the
Syssystem is persisting across test methods.
ReceiveActorreally strips away the need to have them
@Aaronontheweb when working on multi node test runner, I've got following message on the test start:
[NODE1][2015-08-01 07:42:20][DEBUG][[akka://MultiNodeClusterSpec/system/cluster/core/daemon]]: No seed-nodes configured, manual cluster join required
Is it expected?
AwaitClusterUpto manually join nodes
@Aaronontheweb if we need to, then the solution is probably wrong :)
You and I think alike
I've got the solution but it uses reflection :/
let (|JObj|_|) o = let t = typeof<'Message> let jobjType = Type.GetType("Newtonsoft.Json.Linq.JObject, Newtonsoft.Json") if o <> null && o.GetType().Equals jobjType then let mInv = jobjType.GetMethod("ToObject", [|typeof<System.Type>|]) Some (mInv.Invoke(o, [|t|]) :?> 'Message) else None
this is extension for F# pattern mathing that tries to cast passed object to json.net JObject and invoke explicit type conversion to final type on it
let mInv = jobjType.GetMethod("ToObject", [|typeof<System.Type>|])and
let jobjType = Type.GetType("Newtonsoft.Json.Linq.JObject, Newtonsoft.Json")out of that function and store static. expensive lookups
JObject.ToObject(Type)method, that is used to try to cast JObject to specified type. And in F# Actors we know what message type we're expecting
let (|JObj|_|)I get that the JObj can be used for pattern matching, but what is the _ for?
let (|JObj|)and then the caller does not have to handle any other cases.