Making everything compile and tests pass
This commit is contained in:
parent
9ac9e88c31
commit
1a7f29aaec
35 changed files with 101 additions and 59 deletions
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#imports1
|
||||
import akka.actor.Actor
|
||||
import akka.actor.Props
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#test-code
|
||||
import akka.testkit.AkkaSpec
|
||||
import akka.actor.Props
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#all
|
||||
//#imports
|
||||
import akka.actor._
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#testkit
|
||||
import akka.testkit.{ AkkaSpec, ImplicitSender, EventFilter }
|
||||
import akka.actor.{ ActorRef, Props, Terminated }
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#imports1
|
||||
import akka.actor.Actor
|
||||
import akka.actor.Props
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.actor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#imports
|
||||
import akka.dispatch.{ Promise, Future, Await }
|
||||
import akka.util.duration._
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.agent
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.agent.Agent
|
||||
import akka.util.duration._
|
||||
import akka.util.Timeout
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package docs.camel
|
||||
|
||||
object Consumers {
|
||||
{
|
||||
def foo = {
|
||||
//#Consumer1
|
||||
import akka.camel.{ CamelMessage, Consumer }
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ object Consumers {
|
|||
}
|
||||
//#Consumer1
|
||||
}
|
||||
{
|
||||
def bar = {
|
||||
//#Consumer2
|
||||
import akka.camel.{ CamelMessage, Consumer }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package docs.camel
|
||||
|
||||
object Introduction {
|
||||
{
|
||||
def foo = {
|
||||
//#Consumer-mina
|
||||
import akka.camel.{ CamelMessage, Consumer }
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ object Introduction {
|
|||
val mina = sys.actorOf(Props[MinaClient])
|
||||
//#Consumer-mina
|
||||
}
|
||||
{
|
||||
def bar = {
|
||||
//#Consumer
|
||||
import akka.camel.{ CamelMessage, Consumer }
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ object Introduction {
|
|||
}
|
||||
//#Consumer
|
||||
}
|
||||
{
|
||||
def baz = {
|
||||
//#Producer
|
||||
import akka.actor.Actor
|
||||
import akka.camel.{ Producer, Oneway }
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.dispatcher
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import akka.testkit.AkkaSpec
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.future
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import akka.testkit._
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.io
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#imports
|
||||
import akka.actor._
|
||||
import akka.util.{ ByteString, ByteStringBuilder }
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.routing
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.routing.{ ScatterGatherFirstCompletedRouter, BroadcastRouter, RandomRouter, RoundRobinRouter }
|
||||
import annotation.tailrec
|
||||
import akka.actor.{ Props, Actor }
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
package docs.testkit
|
||||
|
||||
import language.postfixOps
|
||||
import language.implicitConversions
|
||||
|
||||
import org.specs2.Specification
|
||||
import org.specs2.specification.{ Step, Scope }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package docs.testkit
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import org.specs2.mutable.Specification
|
||||
import org.specs2.specification.Scope
|
||||
import org.specs2.time.NoTimeConversions
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.testkit
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#testkit-usage
|
||||
import scala.util.Random
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.testkit
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
//#imports-test-probe
|
||||
import akka.testkit.TestProbe
|
||||
import akka.util.duration._
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
package docs.transactor
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.actor._
|
||||
import akka.transactor._
|
||||
import akka.util.duration._
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package docs.zeromq
|
||||
|
||||
import language.postfixOps
|
||||
|
||||
import akka.actor.Actor
|
||||
import akka.actor.Props
|
||||
import akka.util.duration._
|
||||
|
|
@ -30,7 +32,7 @@ object ZeromqDocSpec {
|
|||
|
||||
class HealthProbe extends Actor {
|
||||
|
||||
val pubSocket = context.system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1235"))
|
||||
val pubSocket = ZeroMQExtension(context.system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:1235"))
|
||||
val memory = ManagementFactory.getMemoryMXBean
|
||||
val os = ManagementFactory.getOperatingSystemMXBean
|
||||
val ser = SerializationExtension(context.system)
|
||||
|
|
@ -64,7 +66,7 @@ object ZeromqDocSpec {
|
|||
//#logger
|
||||
class Logger extends Actor with ActorLogging {
|
||||
|
||||
context.system.newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health"))
|
||||
ZeroMQExtension(context.system).newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health"))
|
||||
val ser = SerializationExtension(context.system)
|
||||
val timestampFormat = new SimpleDateFormat("HH:mm:ss.SSS")
|
||||
|
||||
|
|
@ -90,7 +92,7 @@ object ZeromqDocSpec {
|
|||
//#alerter
|
||||
class HeapAlerter extends Actor with ActorLogging {
|
||||
|
||||
context.system.newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health.heap"))
|
||||
ZeroMQExtension(context.system).newSocket(SocketType.Sub, Listener(self), Connect("tcp://127.0.0.1:1235"), Subscribe("health.heap"))
|
||||
val ser = SerializationExtension(context.system)
|
||||
var count = 0
|
||||
|
||||
|
|
@ -121,11 +123,6 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
|
|||
val pubSocket = ZeroMQExtension(system).newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21231"))
|
||||
//#pub-socket
|
||||
|
||||
//#pub-socket2
|
||||
import akka.zeromq._
|
||||
val pubSocket2 = system.newSocket(SocketType.Pub, Bind("tcp://127.0.0.1:21232"))
|
||||
//#pub-socket2
|
||||
|
||||
//#sub-socket
|
||||
import akka.zeromq._
|
||||
val listener = system.actorOf(Props(new Actor {
|
||||
|
|
@ -135,11 +132,11 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
|
|||
case _ ⇒ //...
|
||||
}
|
||||
}))
|
||||
val subSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), SubscribeAll)
|
||||
val subSocket = ZeroMQExtension(system).newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), SubscribeAll)
|
||||
//#sub-socket
|
||||
|
||||
//#sub-topic-socket
|
||||
val subTopicSocket = system.newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), Subscribe("foo.bar"))
|
||||
val subTopicSocket = ZeroMQExtension(system).newSocket(SocketType.Sub, Listener(listener), Connect("tcp://127.0.0.1:21231"), Subscribe("foo.bar"))
|
||||
//#sub-topic-socket
|
||||
|
||||
//#unsub-topic-socket
|
||||
|
|
@ -155,7 +152,7 @@ class ZeromqDocSpec extends AkkaSpec("akka.loglevel=INFO") {
|
|||
system.stop(subTopicSocket)
|
||||
|
||||
//#high-watermark
|
||||
val highWatermarkSocket = system.newSocket(
|
||||
val highWatermarkSocket = ZeroMQExtension(system).newSocket(
|
||||
SocketType.Router,
|
||||
Listener(listener),
|
||||
Bind("tcp://127.0.0.1:21233"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue