Created
November 3, 2014 16:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When should I be using this and when should I be using
rawFetch(keysEnumerator: Enumerator[String])