I´m currently struggeling with implementing my Akka router logic using scaldi for dependency injection. Why cant I bind to a single actor instance with scaldi, since my actor is a router and I only want to have one single instance of it? The way I came to ask this question was another stackoverflow entry.
My scaldi Module:
class DAOModule extends Module {
bind toProvider new UserDaoWorker
binding to new UserDaoRouter
}
This way only one instance is created and as soon as I inject my router multiple times it gets a dead letter actor as sender from the sender() method.
When I change the binding to...
binding toProvider new UserDaoRouter
... it works perfectly fine, but every injection means a new instance of my router. Am I right?
So how can I achieve having only a single instance of my router which is injectable?
Thanks in advance