예제 #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
파일: ActorRef.cs 프로젝트: pkese/Orleankka
 internal ActorRef(ActorPath path, IActorEndpoint endpoint, IActorRefInvoker invoker)
     : this(path)
 {
     this.endpoint = endpoint;
     this.invoker  = invoker;
 }