Пример #1
0
        public static ActorPath ToActorPath(this Type type, string id)
        {
            Requires.NotNull(type, nameof(type));
            var key = ActorTypeName.Of(type);

            return(ActorPath.From(key, id));
        }
Пример #2
0
 public static ActorRef Resolve(string path)
 {
     return(Resolve(ActorPath.From(path)));
 }
Пример #3
0
 public ActorRef(SerializationInfo info, StreamingContext context)
 {
     path     = ActorPath.From((string)info.GetValue("path", typeof(string)));
     invoker  = ActorEndpoint.Invoker(path);
     endpoint = invoker.GetProxy(path.ToString());
 }
Пример #4
0
 /// <summary>
 /// Acquires the actor reference for the given worker type.
 /// </summary>
 /// <param name="system">The reference to actor system</param>
 /// <param name="type">The type</param>
 /// <returns>An actor reference</returns>
 public static ActorRef WorkerOf(this IActorSystem system, string type)
 {
     return(system.ActorOf(ActorPath.From(type, "#")));
 }
Пример #5
0
 /// <summary>
 /// Acquires the actor reference for the given actor type and id.
 /// </summary>
 /// <param name="system">The reference to actor system</param>
 /// <param name="type">The actor type</param>
 /// <param name="id">The actor id</param>
 /// <returns>An actor reference</returns>
 public static ActorRef ActorOf(this IActorSystem system, string type, string id)
 {
     return(system.ActorOf(ActorPath.From(type, id)));
 }
Пример #6
0
 /// <summary>
 /// Acquires the reference for the given id and type of the actor.
 /// </summary>
 /// <typeparam name="TActor">The type of the actor</typeparam>
 /// <param name="system">The reference to actor system</param>
 /// <param name="id">The id</param>
 /// <returns>An actor reference</returns>
 public static ActorRef ActorOf <TActor>(this IActorSystem system, string id) where TActor : Actor
 {
     return(system.ActorOf(ActorPath.From(typeof(TActor), id)));
 }