=doc #3689 Don't rewrite arrows in doc and samples

This commit is contained in:
Patrik Nordwall 2013-12-03 16:34:26 +01:00
parent 37f8f2831b
commit 5a019c0a7a
61 changed files with 531 additions and 517 deletions

View file

@ -21,7 +21,7 @@ object ScalaUdpDocSpec {
IO(Udp) ! Udp.SimpleSender
def receive = {
case Udp.SimpleSenderReady
case Udp.SimpleSenderReady =>
context.become(ready(sender))
//#sender
sender ! Udp.Send(ByteString("hello"), remote)
@ -29,7 +29,7 @@ object ScalaUdpDocSpec {
}
def ready(send: ActorRef): Receive = {
case msg: String
case msg: String =>
send ! Udp.Send(ByteString(msg), remote)
//#sender
if (msg == "world") send ! PoisonPill
@ -44,7 +44,7 @@ object ScalaUdpDocSpec {
IO(Udp) ! Udp.Bind(self, new InetSocketAddress("localhost", 0))
def receive = {
case Udp.Bound(local)
case Udp.Bound(local) =>
//#listener
nextActor forward local
//#listener
@ -52,15 +52,15 @@ object ScalaUdpDocSpec {
}
def ready(socket: ActorRef): Receive = {
case Udp.Received(data, remote)
case Udp.Received(data, remote) =>
val processed = // parse data etc., e.g. using PipelineStage
//#listener
data.utf8String
//#listener
socket ! Udp.Send(data, remote) // example server echoes back
nextActor ! processed
case Udp.Unbind socket ! Udp.Unbind
case Udp.Unbound context.stop(self)
case Udp.Unbind => socket ! Udp.Unbind
case Udp.Unbound => context.stop(self)
}
}
//#listener
@ -71,7 +71,7 @@ object ScalaUdpDocSpec {
IO(UdpConnected) ! UdpConnected.Connect(self, remote)
def receive = {
case UdpConnected.Connected
case UdpConnected.Connected =>
context.become(ready(sender))
//#connected
sender ! UdpConnected.Send(ByteString("hello"))
@ -79,16 +79,16 @@ object ScalaUdpDocSpec {
}
def ready(connection: ActorRef): Receive = {
case UdpConnected.Received(data)
case UdpConnected.Received(data) =>
// process data, send it on, etc.
//#connected
if (data.utf8String == "hello")
connection ! UdpConnected.Send(ByteString("world"))
//#connected
case msg: String
case msg: String =>
connection ! UdpConnected.Send(ByteString(msg))
case d @ UdpConnected.Disconnect connection ! d
case UdpConnected.Disconnected context.stop(self)
case d @ UdpConnected.Disconnect => connection ! d
case UdpConnected.Disconnected => context.stop(self)
}
}
//#connected