예제 #1
0
    public static Definition From(Stage stage, SerializationProxy?proxy, ILogger logger)
    {
        Actor?parent = null;

        if (proxy?.Parent != null)
        {
            ActorProxyBase.Thunk(stage, proxy.Parent);
            parent = stage.Directory.ActorOf(proxy.Parent.Address);
        }

        // thunk actor proxies params if necessary; see also Start grid message
        var thunkParams = proxy?.Parameters
                          .Select(p => ActorProxyBase.Thunk(stage, p))
                          .ToList();

        return(new Definition(
                   proxy?.Type,
                   thunkParams ?? Enumerable.Empty <object>(),
                   parent,
                   proxy?.MailboxName,
                   proxy?.ActorName,
                   logger,
                   proxy?.Evictable ?? false
                   ));
    }
예제 #2
0
 public static TNew Thunk <TNew>(ActorProxyBase proxy, Actor actor, TNew arg) =>
 proxy.IsDistributable ? Thunk(actor.LifeCycle.Environment.Stage, arg) : arg;