protected override bool ReceiveCommand(object message)
{
if (message is string)
{
var s = (string) message;
_probe.Tell(s);
PersistAsync(s + "-outer-async", outer =>
{
_probe.Tell(outer);
Persist(s + "-inner", inner =>
{
_probe.Tell(inner);
Thread.Sleep(1000); // really long wait here
// the next incoming command must be handled by the following function
Context.Become(_ =>
{
Sender.Tell("done");
return true;
});
});
});
return true;
}
return false;
}
}