All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.fehmicansaglam.tepkin.api.MongoClient.scala Maven / Gradle / Ivy

There is a newer version: 0.5
Show newest version
package net.fehmicansaglam.tepkin.api

import akka.actor.ActorRefFactory
import net.fehmicansaglam.tepkin

import scala.concurrent.ExecutionContext

class MongoClient(proxy: tepkin.MongoClient) {

  def ec: ExecutionContext = proxy.ec

  def context: ActorRefFactory = proxy.context

  def db(databaseName: String): MongoDatabase = {
    new MongoDatabase(proxy.apply(databaseName))
  }

  def shutdown(): Unit = {
    proxy.shutdown()
  }
}

object MongoClient {

  /**
   * To be used from Java API.
   */
  def create(uri: String): MongoClient = {
    new MongoClient(tepkin.MongoClient(uri))
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy