WithDriver

Functions to work with driver.

class Object
trait Matchable
class Any
object AcolyteDSL.type

Value members

Concrete methods

def driver(implicit m: DriverManager): AsyncDriver

Returns unmanaged driver. You will have to close it by yourself.

Returns unmanaged driver. You will have to close it by yourself.

def withConnection[A, B](conParam: => A)(f: MongoConnection => B)(implicit d: AsyncDriver, m: ConnectionManager[A], ec: ExecutionContext, compose: ComposeWithCompletion[B]): Outer

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"
 }
def withDriver[T](f: AsyncDriver => T)(implicit m: DriverManager, ec: ExecutionContext, compose: ComposeWithCompletion[T]): Outer

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"
 }