我有一个像下面这样的简单演员:
public class SimpleActor : ReceivePersistentActor
{
public override string PersistenceId => Guid.NewGuid().ToString();
public ProcessActor()
{
CommandAsync<MyMessage>(Process);
Recover<MyMessage>(x =>
{
//do something here to recover
});
}
private async Task Process(MyMessage message)
{
Persist(message, msg =>
{
//handler not being executed
Console.WriteLine($"Persisted - Message {msg.Id}");
});
//some more code which might throw exception
}
}
我正在尝试在内存中执行Persist和Recover但是Persist
处理程序永远不会被运行,也没有抛出任何异常,因此,Recover
也没有被失败的消息调用。我不知道会出现什么问题。