Created
December 6, 2016 14:26
-
-
Save ostronom/df9b6808ac43c14712b557b7c96f57ed to your computer and use it in GitHub Desktop.
This file contains 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
protected def interleaveDevices(devices: List[Device], busId: EventBusId, msgFactory: Device ⇒ ApiWebRTCSignaling): Future[Unit] = { | |
(devices |@| devices).tupled.filter(d => d._1.deviceId != d._2.deviceId).foldLeft(FastFuture.successful[Unit](())) { | |
case (acc, (left, right)) => | |
acc *> postFromThisDevice(busId, left, msgFactory(right).toByteArray) *> postFromThisDevice(busId, right, msgFactory(left).toByteArray) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment