Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created November 3, 2014 16:29
Show Gist options
  • Save mathieuancelin/9dc274b5b48a3d11b7d7 to your computer and use it in GitHub Desktop.
Save mathieuancelin/9dc274b5b48a3d11b7d7 to your computer and use it in GitHub Desktop.
import org.reactivecouchbase.ReactiveCouchbaseDriver
import scala.concurrent.Future
import play.api.libs.json._
object Application extends App {
val driver = ReactiveCouchbaseDriver()
val bucket = driver.bucket("default")
implicit val ec = ExecutionContext.fromExecutor(Executors.newSingleThreadExecutor())
implicit val keys = Seq("key-1", "key-2", "key-3")
Future.sequence(keys.map(key => bucket.get[JsObject](key))).map { listOfDocs =>
// TODO : whatever you need to do ...
}.andThen {
case _ => driver.shutdown()
}
}
@tomer-ben-david
Copy link

When should I be using this and when should I be using rawFetch(keysEnumerator: Enumerator[String])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment