Skip to content

Instantly share code, notes, and snippets.

View NTCoding's full-sized avatar

Nick Tune NTCoding

View GitHub Profile
classDirectory in Compile := file("src/main/webapp/WEB-INF/classes")
libraryDependencies += "eu.infomas" % "annotation-detector" % "3.0.0"
libraryDependencies += "org.atmosphere" % "atmosphere-annotations" % "2.0.0.RC3"
libraryDependencies += "javax.servlet" % "servlet-api" % "2.5"
libraryDependencies += "org.mortbay.jetty" % "servlet-api" % "3.0.20100224"
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
<?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>
➜ 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/)
>
name := "Atmosphere Scala"
scalaVersion := "2.10.2"
libraryDependencies += "org.atmosphere" % "atmosphere-runtime" % "2.0.0.RC3"
nano build.sbt
mkdir -p src/main/{scala,webapp}
@NTCoding
NTCoding / kill_jvm.scala
Last active December 18, 2015 20:39
kill jvm
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
}