WithDriver
Functions to work with driver.
Value members
Concrete methods
Returns unmanaged driver. You will have to close it by yourself.
Returns unmanaged driver. You will have to close it by yourself.
Works with connection with options appropriate for a driver
initialized using Acolyte for ReactiveMongo
(should not be used with other driver instances).
Connection is closed after the result Future
is completed.
Works with connection with options appropriate for a driver
initialized using Acolyte for ReactiveMongo
(should not be used with other driver instances).
Connection is closed after the result Future
is completed.
- Value parameters:
- conParam
the connection manager parameter (see ConnectionManager)
- f
the function applied to initialized driver
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.{ MongoConnection, AsyncDriver } import acolyte.reactivemongo.{ AcolyteDSL, ConnectionHandler } // handler: ConnectionHandler def s(handler: ConnectionHandler)( implicit ec: ExecutionContext, d: AsyncDriver): Future[String] = AcolyteDSL.withConnection(handler) { (_: MongoConnection) => "Result" }
Works with MongoDB driver configured with Acolyte handlers.
Driver and associated resources are released
after the function f
the result Future
is completed.
Works with MongoDB driver configured with Acolyte handlers.
Driver and associated resources are released
after the function f
the result Future
is completed.
- Value parameters:
- f
the function applied to initialized driver
import scala.concurrent.{ ExecutionContext, Future } import reactivemongo.api.AsyncDriver import acolyte.reactivemongo.AcolyteDSL // handler: ConnectionHandler def s(implicit ec: ExecutionContext): Future[String] = AcolyteDSL.withDriver { (_: AsyncDriver) => "Result" }