As far as I see it, you are using the Sedis play plugin which supports the Guice injection model. However, if you use only Sedis, independent of the plugin, you can instantiate it as any other object, like this:
val pool = new Pool(new JedisPool(new JedisPoolConfig(), "localhost", 6379, 2000))
Edit:
I just checked, it is completely ok to also inject the Pool
into a filter. I tried it.
class ExampleFilter @Inject() (sedisPool: Pool) extends Filter {
override def apply(nextFilter: (RequestHeader) => Future[Result])(rh: RequestHeader): Future[Result] =
{
println(this.sedisPool)
//do your stuff.
nextFilter(rh)
}
}
This is possible because the filter sequence is also injected with Guice in 2.4.x.