src/main/scala/Example.scala
author Tomas Zeman <tzeman@volny.cz>
Tue, 21 Jul 2015 09:24:52 +0200
changeset 0 a279a342bc78
child 2 04af787ba66f
permissions -rw-r--r--
Initial import

package couchdb.changes

import akka.actor._
import spray.http.Uri

object LoggingActor extends Actor with ActorLogging {
  log.info("Initializing LoggingActor")
  def receive: Receive = {
    case x => log.info("Received {}", x)
  }
}

object Example extends App {

  val system = ActorSystem()
  val stream = system.actorOf(Props(new ChangesStreamActor(
    system.actorOf(Props(LoggingActor)))))

  stream ! Uri("http://localhost:5984/example/_changes").withQuery(
    "feed" -> "continuous"
  , "heartbeat" -> "5000"
  , "include_docs" -> "true"
  )

}

// vim: set ts=2 sw=2 et: