This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| classDirectory in Compile := file("src/main/webapp/WEB-INF/classes") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| libraryDependencies += "eu.infomas" % "annotation-detector" % "3.0.0" | |
| libraryDependencies += "org.atmosphere" % "atmosphere-annotations" % "2.0.0.RC3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| libraryDependencies += "javax.servlet" % "servlet-api" % "2.5" | |
| libraryDependencies += "org.mortbay.jetty" % "servlet-api" % "3.0.20100224" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package atmo_demo | |
| import org.atmosphere.config.service.{Disconnect, Ready, ManagedService} | |
| import org.atmosphere.cpr._ | |
| @ManagedService(path = "/search") | |
| class Searcher { | |
| private var factory: BroadcasterFactory = null | |
| @Ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" | |
| xmlns:j2ee="http://java.sun.com/xml/ns/javaee" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2.5.xsd"> | |
| <description>Atmosphere Scala SBT Demo</description> | |
| <display-name>Atmosphere Scala SBT Demo</display-name> | |
| <servlet> | |
| <description>AtmosphereServlet</description> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ atmo_demo git:(master) ✗ sbt | |
| Loading /usr/opt/sbt/sbt/bin/sbt-launch-lib.bash | |
| [info] Loading global plugins from /home/nick/.sbt/0.13/plugins | |
| [info] Set current project to Atmosphere Scala (in build file:/home/nick/repos/ScalaPlayground/atmo_demo/) | |
| > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name := "Atmosphere Scala" | |
| scalaVersion := "2.10.2" | |
| libraryDependencies += "org.atmosphere" % "atmosphere-runtime" % "2.0.0.RC3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nano build.sbt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p src/main/{scala,webapp} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case (sender, data) if numberOfMessages >= 20000 => { | |
| println(s"About to shutdown the system and not process: $sender - $data") | |
| Thread.sleep(5000) | |
| sys.exit() // <-- shutdown this instance of the JVM | |
| } |