Aaronontheweb on dev
Fix #4083 - Endpoint receive bu… (compare)
Context.ActorOf
it doesn't seem possible, unless, of course, there's way to hook into some Context.ActorOf
test callback if one exists. Another approach I've found is to pass a dependency into X which is responsible for creating children and substitute it when testing. Or... maybe just extend the static Props actor creator for X and make it receive a lambda which takes in the Context
SetState
in the unit test, and advises testing for side-effects external from the FSM. That certainly sounds like it could reduce test breakage. Anyone here experienced with testing FSMs? What do you recommend?
public sealed class TestProbeWrapper : UntypedActor
{
private readonly IActorRef _target;
public TestProbeWrapper(IActorRef target)
{
_target = target ?? throw new ArgumentNullException( nameof( target ) );
}
protected override void OnReceive( object message )
{
_target.Forward( message );
}
}
Props.Create( () => new TestProbeWrapper( getActorProbe ) )
@Horusiath what is a more typed way to make an Ask?
let loop (ctx: Actor<Msg>) (state: State) = function
| GetConfiguration ->
ctx.Sender() <! (Ok state.Configuration : Result<Configuration, string>)
ignored()
here if I remove the type hint it's inferred as Result<Configuration, obj>
which results with disasters.
It's an entry point to the actor system, so I cannot pass an IActorRef<>
.
ReplyTo
), which contains an actor to which you may want respond to. Then in code instead of sending reply to Sender, send it to msg.ReplyTo
. This could work with ask via Ask overload - tbh. I'm not sure if this method is already published.
max-buffer-size=500000
, after that size is reached any more writes will be denied until buffer will be freed). These writes are picked into batches (up to max-batch-size=100
) and every batch is essentially a single db request - keep in mind that if you store mutliple events in a single Persist request, they all count as 1 atomic write.
max-concurrent-operations=64
). keep in mind, that every operation uses separate db connection - ADO.NET is pooling them and afaik pool size is 100 by default.