Returns unmanaged driver.
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).
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.
Connection manager parameter (see ConnectionManager)
Function applied to initialized connection
import reactivemongo.api.MongoConnection import acolyte.reactivemongo.AcolyteDSL // handler: ConnectionHandler val s: Future[String] = AcolyteDSL.withConnection(handler) { con => val c: MongoConnection = con "Result" }
Works with Mongo driver configured with Acolyte handlers.
Works with Mongo driver configured with Acolyte handlers.
Driver and associated resources are released
after the function f
the result Future
is completed.
Function applied to initialized driver
// handler: ConnectionHandler val s: Future[String] = withDriver { d => val initedDriver: MongoDriver = d "Result" }
Works with connection with options appropriate for a driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).
Works with connection with options appropriate for a driver initialized using Acolyte for ReactiveMongo (should not be used with other driver instances).
Connection manager parameter (see ConnectionManager)
Function applied to initialized connection
import reactivemongo.api.MongoConnection import acolyte.reactivemongo.AcolyteDSL // handler: ConnectionHandler val s: Future[String] = AcolyteDSL.withFlatConnection(handler) { con => val c: MongoConnection = con Future.successful("Result") }
Works with Mongo driver configured with Acolyte handlers.
Works with Mongo driver configured with Acolyte handlers.
Driver and associated resources are released
after the function f
the result Future
is completed.
Function applied to initialized driver (returning a future)
// handler: ConnectionHandler val s: Future[String] = withFlatDriver { d => val initedDriver: MongoDriver = d Future.successful("Result") }
Functions to work with driver.