Fix sendMessageReliablySync
This commit is contained in:
parent
e7a5cbb543
commit
741899b21e
|
@ -14,7 +14,8 @@ import scala.collection.mutable.SynchronizedQueue
|
||||||
import scala.collection.mutable.Queue
|
import scala.collection.mutable.Queue
|
||||||
import scala.collection.mutable.ArrayBuffer
|
import scala.collection.mutable.ArrayBuffer
|
||||||
|
|
||||||
import akka.dispatch.{Promise, ExecutionContext, Future}
|
import akka.dispatch.{Await, Promise, ExecutionContext, Future}
|
||||||
|
import akka.util.Duration
|
||||||
|
|
||||||
case class ConnectionManagerId(host: String, port: Int) {
|
case class ConnectionManagerId(host: String, port: Int) {
|
||||||
def toSocketAddress() = new InetSocketAddress(host, port)
|
def toSocketAddress() = new InetSocketAddress(host, port)
|
||||||
|
@ -325,7 +326,7 @@ class ConnectionManager(port: Int) extends Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
def sendMessageReliablySync(connectionManagerId: ConnectionManagerId, message: Message): Option[Message] = {
|
def sendMessageReliablySync(connectionManagerId: ConnectionManagerId, message: Message): Option[Message] = {
|
||||||
sendMessageReliably(connectionManagerId, message)()
|
Await.result(sendMessageReliably(connectionManagerId, message), Duration.Inf)
|
||||||
}
|
}
|
||||||
|
|
||||||
def onReceiveMessage(callback: (Message, ConnectionManagerId) => Option[Message]) {
|
def onReceiveMessage(callback: (Message, ConnectionManagerId) => Option[Message]) {
|
||||||
|
|
Loading…
Reference in a new issue