Class/Object

reactivemongo.api

AsyncDriver

Related Docs: object AsyncDriver | package api

Permalink

final class AsyncDriver extends AnyRef

The asynchronous driver (see MongoConnection).

import scala.concurrent.Future
import reactivemongo.api.{ AsyncDriver, MongoConnection }

val driver = AsyncDriver()
val connection: Future[MongoConnection] =
  driver.connect("mongodb://node:27017")
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncDriver
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AsyncDriver(config: Option[Config] = None, classLoader: Option[ClassLoader] = None)

    Permalink

    config

    a custom configuration (otherwise the default options are used)

    classLoader

    a classloader used to load the actor system

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to any2stringadd[AsyncDriver] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (AsyncDriver, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to ArrowAssoc[AsyncDriver] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def askConnection(nodes: Seq[String], options: MongoConnectionOptions, name: Option[String]): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection.

    Creates a new MongoConnection.

    nodes

    The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)

    options

    the options for the new connection pool

    name

    the name for the connection pool

    Attributes
    protected
  8. val classLoader: Option[ClassLoader]

    Permalink

    a classloader used to load the actor system

    a classloader used to load the actor system

    Attributes
    protected
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def close(timeout: FiniteDuration = FiniteDuration(2, SECONDS))(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Closes this driver (and all its connections and resources).

    Closes this driver (and all its connections and resources). Will wait until the timeout for proper closing of connections before forcing hard shutdown.

    import scala.concurrent.ExecutionContext
    
    def afterClose(drv: reactivemongo.api.AsyncDriver)(
      implicit ec: ExecutionContext) = drv.close().andThen {
        case res => println("Close 'Try' result: " + res)
      }
  11. val config: Option[Config]

    Permalink

    a custom configuration (otherwise the default options are used)

    a custom configuration (otherwise the default options are used)

    Attributes
    protected
  12. def connect[T](parsedURI: URI[T]): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection from URI.

    Creates a new MongoConnection from URI.

    parsedURI

    the URI parsed by reactivemongo.api.MongoConnection.fromString

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI
    val driver = reactivemongo.api.AsyncDriver()
    def con(uri: ParsedURI): Future[MongoConnection] = driver.connect(uri)
    // with automatic name
  13. def connect[T](parsedURI: URI[T], name: Option[String], strictMode: Boolean): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection from URI.

    Creates a new MongoConnection from URI.

    parsedURI

    The URI parsed by reactivemongo.api.MongoConnection.fromString

    name

    the name for the connection pool

    strictMode

    the flag to indicate whether the given URI must be a strict one (no ignored/invalid options)

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI
    val driver = reactivemongo.api.AsyncDriver()
    def con(uri: ParsedURI): Future[MongoConnection] =
      driver.connect(uri, name = Some("ConnectionName"))
  14. def connect[T](parsedURI: URI[T], name: Option[String]): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection from URI.

    Creates a new MongoConnection from URI.

    parsedURI

    The URI parsed by reactivemongo.api.MongoConnection.fromString

    name

    the name for the connection pool

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection, MongoConnection.ParsedURI
    val driver = reactivemongo.api.AsyncDriver()
    def con(uri: ParsedURI): Future[MongoConnection] =
      driver.connect(uri, name = Some("ConnectionName"))
  15. def connect(uriStrict: String, name: Option[String]): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection from URI.

    Creates a new MongoConnection from URI.

    uriStrict

    the strict URI, that will be parsed by reactivemongo.api.MongoConnection.fromString

    name

    the name for the connection pool

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection
    val driver = reactivemongo.api.AsyncDriver()
    val con: Future[MongoConnection] = driver.connect("mongodb://user123:passwd123@host1:27018,host2:27019,host3:27020/somedb?foo=bar&authenticationMechanism=scram-sha1", name = Some("ConnectionName"))
  16. def connect(uriStrict: String): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection from URI.

    Creates a new MongoConnection from URI.

    uriStrict

    the strict URI, that will be parsed by reactivemongo.api.MongoConnection.fromString

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection
    val driver = reactivemongo.api.AsyncDriver()
    val con: Future[MongoConnection] = driver.connect("mongodb://user123:passwd123@host1:27018,host2:27019,host3:27020/somedb?foo=bar&authenticationMechanism=scram-sha1")
    // with automatic name
  17. def connect(nodes: Seq[String], options: MongoConnectionOptions, name: String): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection.

    Creates a new MongoConnection.

    nodes

    The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)

    options

    the options for the new connection pool

    name

    the name for the connection pool

    import scala.concurrent.Future
    import reactivemongo.api.{ MongoConnection, MongoConnectionOptions }
    val driver = reactivemongo.api.AsyncDriver()
    val con: Future[MongoConnection] = driver.connect(
      nodes = Seq("node1:27017", "node2:27017", "node3:27017"),
      options = MongoConnectionOptions.default.copy(nbChannelsPerNode = 10),
      name = "ConnectionName")
  18. def connect(nodes: Seq[String], options: MongoConnectionOptions): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection.

    Creates a new MongoConnection.

    nodes

    The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)

    options

    the options for the new connection pool

    import scala.concurrent.Future
    import reactivemongo.api.{ MongoConnection, MongoConnectionOptions }
    val driver = reactivemongo.api.AsyncDriver()
    val con: Future[MongoConnection] = driver.connect(
      nodes = Seq("node1:27017", "node2:27017", "node3:27017"),
      options = MongoConnectionOptions.default.copy(nbChannelsPerNode = 10))
    // with automatic name
  19. def connect(nodes: Seq[String]): Future[MongoConnection]

    Permalink

    Creates a new MongoConnection.

    Creates a new MongoConnection.

    nodes

    The list of node names (e.g. node1.foo.com:27017); Port is optional (27017 is used by default)

    import scala.concurrent.Future
    import reactivemongo.api.MongoConnection
    val driver = reactivemongo.api.AsyncDriver()
    val con: Future[MongoConnection] = driver.connect(
      Seq("node1:27017", "node2:27017", "node3:27017"))
    // with default options and automatic name
  20. final val connectionMonitors: Map[ActorRef, MongoConnection]

    Permalink
    Attributes
    protected
  21. def ensuring(cond: (AsyncDriver) ⇒ Boolean, msg: ⇒ Any): AsyncDriver

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to Ensuring[AsyncDriver] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: (AsyncDriver) ⇒ Boolean): AsyncDriver

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to Ensuring[AsyncDriver] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: Boolean, msg: ⇒ Any): AsyncDriver

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to Ensuring[AsyncDriver] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. def ensuring(cond: Boolean): AsyncDriver

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to Ensuring[AsyncDriver] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  25. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to StringFormat[AsyncDriver] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. final val supervisorName: String

    Permalink
    Attributes
    protected
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def [B](y: B): (AsyncDriver, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from AsyncDriver to ArrowAssoc[AsyncDriver] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AsyncDriver to any2stringadd[AsyncDriver]

Inherited by implicit conversion StringFormat from AsyncDriver to StringFormat[AsyncDriver]

Inherited by implicit conversion Ensuring from AsyncDriver to Ensuring[AsyncDriver]

Inherited by implicit conversion ArrowAssoc from AsyncDriver to ArrowAssoc[AsyncDriver]

Ungrouped