-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
actor-integration 📬Integration with Akka.NET runtimeIntegration with Akka.NET runtime
Description
While adding support to cusomtized actor type names (see my prefious issue), we hit a problem with unit test failures due to InvalidCastException (attempt to cast LocalRefProvider to PhobosActorRefProvider). And the cast was invalid indeed because our unit tests don't use Phobos, they use ActorSystem instance obtained from the Akka.TestKit. So the following code failed:
props.ToProps().WithInstrumentation(system, _.WithActorTypeName(actorTypeName))
To fix the tests we had to check ActorSystem.Settings.ProvideClass string:
if system.Settings.ProviderClass.StartsWith "Phobos.Actor" then
props.ToProps().WithInstrumentation(system, _.WithActorTypeName(actorTypeName))
else
props.ToProps()
The check should support both providers from both Phobos.Actor and Phobos.Actor.Cluster. But this check is fragile.
Is there an alternative way to detect it the actor system is powered by Phobos, without comparing magic strings?
Metadata
Metadata
Assignees
Labels
actor-integration 📬Integration with Akka.NET runtimeIntegration with Akka.NET runtime