示例#1
0
 /// <summary>
 /// Acquires the actor reference for the given actor path string.
 /// </summary>
 /// <param name="system">The reference to actor system</param>
 /// <param name="path">The path string</param>
 /// <returns>An actor reference</returns>
 public static ActorRef ActorOf(this IActorSystem system, string path)
 {
     return(system.ActorOf(ActorPath.Parse(path)));
 }
示例#2
0
 public async Task <TResult> Send <TResult>(ActorPath actor, object message, Func <object, Task <object> > invoke) =>
 (TResult) await invoke(message);
示例#3
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="interface">The actor interface</param>
 /// <param name="id">The actor id</param>
 /// <returns>An actor reference</returns>
 public static ActorRef ActorOf(this IActorSystem system, Type @interface, string id)
 {
     return(system.ActorOf(ActorPath.For(@interface, id)));
 }
示例#4
0
 ActorRef(ActorPath path, IActorEndpoint endpoint)
     : this(path)
 {
     this.endpoint = endpoint;
     @interface    = ActorInterface.Of(path);
 }
示例#5
0
 public static ActorRef Deserialize(ActorPath path) => new ActorRef(path, ActorInterface.Registered(path.Type));
示例#6
0
 /// <summary>
 /// Acquires the typed actor reference for the given id and type of the worker actor.
 /// The type could be either an interface or implementation class.
 /// </summary>
 /// <typeparam name="TActor">The type of the actor</typeparam>
 /// <param name="system">The reference to actor system</param>
 public static ActorRef <TActor> TypedWorkerOf <TActor>(this IActorSystem system) where TActor : IActorGrain
 {
     return(new ActorRef <TActor>(system.ActorOf(ActorPath.For(typeof(TActor), "#"))));
 }
示例#7
0
 public static ActorRef Deserialize(ActorPath path) => new ActorRef(path, ActorEndpoint.Proxy(path));
示例#8
0
 protected ActorRef(ActorPath path)
 {
     Path = path;
 }
示例#9
0
 internal ActorRef(ActorPath path, IActorGrain endpoint, IActorRefMiddleware middleware)
     : this(path)
 {
     this.endpoint   = endpoint;
     this.middleware = middleware;
 }
示例#10
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)));
 }
示例#11
0
 public ActorRef ActorOf(Type type, string id)
 {
     return ActorOf(ActorPath.Registered(type, id));
 }
示例#12
0
 public bool Equals(ActorPath other)
 {
     return(path.Equals(other));
 }
示例#13
0
 ActorRef(ActorPath path, IActorEndpoint endpoint) : this(path)
 {
     this.endpoint = endpoint;
 }
示例#14
0
 ActorRef(ActorPath path, ActorInterface @interface)
     : this(path)
 {
     endpoint = @interface.Proxy(path);
 }
示例#15
0
 /// <summary>
 /// Acquires the actor reference for the given worker type.
 /// </summary>
 /// <param name="system">The reference to actor system</param>
 /// <param name="interface">The worker interface</param>
 /// <returns>An actor reference</returns>
 public static ActorRef WorkerOf(this IActorSystem system, Type @interface)
 {
     return(system.ActorOf(ActorPath.For(@interface, "#")));
 }
示例#16
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)));
 }
示例#17
0
 /// <summary>
 /// Acquires the typed actor reference for the given id and type of the actor.
 /// The type could be either an interface or implementation class.
 /// </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>
 public static ActorRef <TActor> TypedActorOf <TActor>(this IActorSystem system, string id) where TActor : IActorGrain
 {
     return(new ActorRef <TActor>(system.ActorOf(ActorPath.For(typeof(TActor), id))));
 }
示例#18
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, "#")));
 }
示例#19
0
 public static ActorRef Deserialize(string path) => Deserialize(ActorPath.Deserialize(path));
示例#20
0
 ActorPlacementRequest(ActorPath path, ActorInterfaceMapping mapping)
 {
     Path                = path;
     CustomInterface     = mapping.CustomInterface;
     ImplementationClass = mapping.ImplementationClass;
 }
示例#21
0
 protected internal ActorRef(ActorPath path)
 {
     Path = path;
 }
示例#22
0
 public virtual Task <TResult> Send <TResult>(ActorPath actor, object message, Func <object, Task <object> > invoke) =>
 next.Send <TResult>(actor, message, invoke);
示例#23
0
 public bool Equals(ActorPath other) => Path.Equals(other);
示例#24
0
 internal ActorRef(ActorPath path, IActorEndpoint endpoint, IActorRefInvoker invoker)
     : this(path)
 {
     this.endpoint = endpoint;
     this.invoker  = invoker;
 }