Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reliable Actor with multiple interfaces?

Is there a way to create an actor that has two interfaces? I want to define the public interface in the Interfaces assembly and the internal interface in the actor assembly. The reason is to separate methods that clients should use and methods that the system should use.

For example:

class MyActor
    : Actor
    , IPublicInterface
    , IInternalInterface
{
    ...
}

It looks like this is not possible because the ActorService attribute only allows for a single name.

Is there a better way (that works) to segregate public and internal methods?

like image 290
Eli Pulsifer Avatar asked Jul 02 '26 23:07

Eli Pulsifer


1 Answers

When you have more than one interface, the runtime cannot generate the default name for the service. You need to apply https://msdn.microsoft.com/en-us/library/azure/microsoft.servicefabric.actors.runtime.actorserviceattribute.aspx

[ActorService(Name="MyActorService")] to your actor implementation. You can then create the actor proxy with this servicename using https://msdn.microsoft.com/en-us/library/azure/mt694503.aspx method.

like image 180
VipulM-MSFT Avatar answered Jul 05 '26 12:07

VipulM-MSFT