Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some clean-up

  • Loading branch information...
commit fa8e17d67aac519319b0f2de68b0e073474b1bf9 1 parent 05d180e
felix authored
View
1  nrv-core/src/main/scala/com/wajam/nrv/data/InRequest.scala
@@ -5,7 +5,6 @@ package com.wajam.nrv.data
*/
class InRequest extends Message {
var replyCallback:(OutRequest => Unit) = null
- var transportReplyCallback:(OutRequest => Unit) = null
def reply(data:(String,Any)*) {
this.reply(new OutRequest(data))
View
4 nrv-core/src/main/scala/com/wajam/nrv/protocol/Protocol.scala
@@ -18,9 +18,7 @@ abstract class Protocol(var name: String, cluster: Cluster) extends MessageHandl
def handleIncoming(action: Action, message: Message) {
val inReq = new InRequest
- val serMessage = message.asInstanceOf[Message]
- serMessage.copyTo(inReq)
-
+ message.copyTo(inReq)
this.cluster.route(inReq)
}
View
4 nrv-core/src/main/scala/com/wajam/nrv/transport/Transport.scala
@@ -2,6 +2,7 @@ package com.wajam.nrv.transport
import com.wajam.nrv.protocol.Protocol
import java.net.{InetSocketAddress, URI, InetAddress}
+import com.wajam.nrv.data.Message
/**
* This class...
@@ -20,3 +21,6 @@ abstract class Transport (host: InetAddress, port: Int, protocol: Protocol) {
completionCallback: Option[Throwable] => Unit = (_) => {})
}
+
+class TransportMessage(var sendResponseCallback: (Message) => Unit) extends Message
+
View
2  nrv-core/src/main/scala/com/wajam/nrv/transport/netty/NettyTransport.scala
@@ -4,11 +4,11 @@ import java.util.concurrent.Executors
import org.jboss.netty.channel.group.DefaultChannelGroup
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory
import org.jboss.netty.bootstrap.{ClientBootstrap, ServerBootstrap}
-import com.wajam.nrv.transport.{Transport}
import com.wajam.nrv.protocol.Protocol
import org.jboss.netty.channel._
import com.wajam.nrv.Logging
import java.net.{URI, InetAddress, InetSocketAddress}
+import com.wajam.nrv.transport.{TransportMessage, Transport}
/**
* Transport implementation based on Netty.
View
2  nrv-core/src/test/scala/com/wajam/nrv/transport/netty/TestNettyTransport.scala
@@ -85,7 +85,7 @@ class TestNettyTransport extends FunSuite with BeforeAndAfter {
nettyTransport.sendMessage(new InetSocketAddress("127.0.0.1", port), "hello")
notifier.synchronized {
- notifier.wait(100)
+ notifier.wait(1000)
}
assert(mockProtocol.receivedMessage != null)
Please sign in to comment.
Something went wrong with that request. Please try again.