Skip to content

Dependency Injection is not retrieving delegates #4921

@bauersystems

Description

@bauersystems
  • Akka version: 1.4.18
  • Akka.DependencyInjection version: 1.4.18
  • Platform: Windows 10
  • Steps to reproduce:

Create a simple delegate:
public delegate IActorRef BatchManagerActorProvider();

Add the delegate as a Singleton:
services.AddSingleton<BatchManagerActorProvider>(provider => { IActorRef batchManagerActor = actorSystem.ActorOf(BatchManagerActor.CreateProps(), "batchManager"); return () => batchManagerActor; });

Attempt to retrieve the delegate via the Service Provider:
var Actor = ServiceProvider.For(Context.System).Provider.GetService(typeof(BatchManagerActorProvider));

Retrieving the delegate within an MVC controller works perfectly, so the delegate is registered successfully. Retrieving a standard class from the Service Provider in an Actor works perfectly too.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions