Udostępnij za pośrednictwem


ActorProxy.Create Method

Definition

Overloads

Create<TActorInterface>(ActorId, Uri, String)

Creates a proxy to the actor object that implements an actor interface.

Create<TActorInterface>(ActorId, String, String, String)

Creates a proxy to the actor object that implements an actor interface.

Create<TActorInterface>(ActorId, Uri, String)

Creates a proxy to the actor object that implements an actor interface.

public static TActorInterface Create<TActorInterface> (Microsoft.ServiceFabric.Actors.ActorId actorId, Uri serviceUri, string listenerName = default) where TActorInterface : Microsoft.ServiceFabric.Actors.IActor;
static member Create : Microsoft.ServiceFabric.Actors.ActorId * Uri * string -> 'ActorInterface (requires 'ActorInterface :> Microsoft.ServiceFabric.Actors.IActor)
Public Shared Function Create(Of TActorInterface As IActor) (actorId As ActorId, serviceUri As Uri, Optional listenerName As String = Nothing) As TActorInterface

Type Parameters

TActorInterface

The actor interface implemented by the remote actor object. The returned proxy object will implement this interface.

Parameters

actorId
ActorId

Actor Id of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this id.

serviceUri
Uri

Uri of the actor service.

listenerName
String

By default an actor service has only one listener for clients to connect to and communicate with. However it is possible to configure an actor service with more than one listeners, the listenerName parameter specifies the name of the listener to connect to.

Returns

TActorInterface

An actor proxy object that implements IActorProxy and TActorInterface.

Applies to

Create<TActorInterface>(ActorId, String, String, String)

Creates a proxy to the actor object that implements an actor interface.

public static TActorInterface Create<TActorInterface> (Microsoft.ServiceFabric.Actors.ActorId actorId, string applicationName = default, string serviceName = default, string listenerName = default) where TActorInterface : Microsoft.ServiceFabric.Actors.IActor;
static member Create : Microsoft.ServiceFabric.Actors.ActorId * string * string * string -> 'ActorInterface (requires 'ActorInterface :> Microsoft.ServiceFabric.Actors.IActor)
Public Shared Function Create(Of TActorInterface As IActor) (actorId As ActorId, Optional applicationName As String = Nothing, Optional serviceName As String = Nothing, Optional listenerName As String = Nothing) As TActorInterface

Type Parameters

TActorInterface

The actor interface implemented by the remote actor object. The returned proxy object will implement this interface.

Parameters

actorId
ActorId

The actor ID of the proxy actor object. Methods called on this proxy will result in requests being sent to the actor with this ID.

applicationName
String

The name of the Service Fabric application that contains the actor service hosting the actor objects. This parameter can be null if the client is running as part of that same Service Fabric application. For more information, see Remarks.

serviceName
String

The name of the Service Fabric service as configured by ActorServiceAttribute on the actor implementation. By default, the name of the service is derived from the name of the actor interface. However, ActorServiceAttribute is required when an actor implements more than one actor interface or an actor interface derives from another actor interface since the service name cannot be determined automatically.

listenerName
String

By default an actor service has only one listener for clients to connect to and communicate with. However, it is possible to configure an actor service with more than one listener. This parameter specifies the name of the listener to connect to.

Returns

TActorInterface

An actor proxy object that implements IActorProxy and TActorInterface.

Remarks

The applicationName parameter can be null if the client is running as part of the same Service Fabric application as the actor service it intends to communicate with. In this case, the application name is determined from CodePackageActivationContext, and is obtained by calling the ApplicationName property.

Applies to