Last active
March 17, 2016 12:31
-
-
Save htimur/11f79e2ba836c42e3da5 to your computer and use it in GitHub Desktop.
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
| def source(client: MongoClient): Source[Document, NotUsed] = { | |
| val observable = client.getDatabase("local") | |
| .getCollection("oplog.rs") | |
| .find(and( | |
| in("op", "i", "d", "u"), | |
| exists("fromMigrate", false))) | |
| .cursorType(CursorType.TailableAwait) | |
| .noCursorTimeout(true) | |
| Source.fromPublisher(observable) | |
| } | |
| val sources = shards.map({ shard => | |
| val client = MongoClient(shard.uri) | |
| source(client) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment