You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this while investigating petabridge/phobos-issues#16 - the problem is that any of the methods you might typically use on Props, i.e. Props.WithSupervisorStrategy et al don't work with the ServiceProviderProps.
Instead, we need to refactor that mechanism to use the IIndirectActorProducer much like how we did with the original Akka.DI.Core implementation here:
/// Initializes a new instance of the <see cref="DIActorProducer"/> class.
/// </summary>
/// <param name="dependencyResolver">The resolver used to resolve the given actor type.</param>
/// <param name="actorType">The type of actor that this producer creates.</param>
/// <exception cref="ArgumentNullException">
/// This exception is thrown when either the specified <paramref name="dependencyResolver"/> or the specified <paramref name="actorType"/> is undefined.
if(dependencyResolver==null)thrownew ArgumentNullException(nameof(dependencyResolver),$"DIActorProducer requires {nameof(dependencyResolver)} to be provided");
if(actorType==null)thrownew ArgumentNullException(nameof(actorType),$"DIActorProducer requires {nameof(actorType)} to be provided");
/// Creates an actor based on the container's implementation specific actor factory.
/// </summary>
/// <returns>An actor created by the container.</returns>
public ActorBase Produce()
{
return actorFactory();
}
/// <summary>
/// Signals the container that it can release its reference to the actor.
/// </summary>
/// <param name="actor">The actor to remove from the container.</param>
publicvoidRelease(ActorBaseactor)
{
dependencyResolver.Release(actor);
}
}
So this is going to be a breaking change to Akka.DependencyInjection, although one that shouldn't have much real-world impact as the underlying types are all abstracted away from the users of the library and the ServiceProvider interface shouldn't have any problems with it.
The text was updated successfully, but these errors were encountered:
Version: 1.4.17
Ran into this while investigating petabridge/phobos-issues#16 - the problem is that any of the methods you might typically use on
Props
, i.e.Props.WithSupervisorStrategy
et al don't work with theServiceProviderProps
.Instead, we need to refactor that mechanism to use the
IIndirectActorProducer
much like how we did with the original Akka.DI.Core implementation here:akka.net/src/contrib/dependencyinjection/Akka.DI.Core/DIActorProducer.cs
Lines 16 to 66 in 444432a
So this is going to be a breaking change to Akka.DependencyInjection, although one that shouldn't have much real-world impact as the underlying types are all abstracted away from the users of the library and the
ServiceProvider
interface shouldn't have any problems with it.The text was updated successfully, but these errors were encountered: