matthiasn / sse-chat Goto Github PK
View Code? Open in Web Editor NEWChat example app using Server Sent Events plus REST calls. Scala, Play Framework 2.3, AngularJS or React (alternatively).
Home Page: http://matthiasnehlsen.com
License: Other
Chat example app using Server Sent Events plus REST calls. Scala, Play Framework 2.3, AngularJS or React (alternatively).
Home Page: http://matthiasnehlsen.com
License: Other
suspicion: Concurrent.broadcast calls attached Iteratees sequentially. If SSE connection to client not properly closed: time-out
attempted fix: buffering:
Ok.stream(chatOut &> roomFilter(room)
&> ipFilter(req.remoteAddress)
&> toJsValue
&> Concurrent.buffer(20)
&> EventSource()).as("text/event-stream")
Hi Matthias,
We have deconnexion using Ok.feed on heroku. It seems that Ok.chunk should be more apropriate when the connexion is persistent without knowing the total lenght of the stream data and Ok.feed is usefull when streaming a know length, for example streaming a long file.
What is your experience/tests on both methods as the Play documentation is not very helpfull.
Hi Matthias,
I am trying to run your application and getting the following exception:
java.lang.NoClassDefFoundError: scala/StringContext
at sbt.CommandStrings$.(CommandStrings.scala:62)
at sbt.CommandStrings$.(CommandStrings.scala)
at sbt.BuiltinCommands$.initialize(Main.scala:195)
at sbt.xMain.run(Main.scala:27)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: scala.StringContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 11 more
Error during sbt execution: java.lang.NoClassDefFoundError: scala/StringContext
I have play 2.1.4 installed on my box, sbt 0.13.0 and scala 2.10.3.
Thank you in advance!
I am trying to run this on Ubuntu 14.04, openjdk 7. After the initial downloading of dependencies, the run task seems to hang for a long time, with no messages except the below:
./activator run
[info] Loading project definition from /home/user/sse-chat/project
Hello,
Thanks for your app, it helped me a lot to understand how to do SSE with Play.
However, I did this test : I opened the chatroom in multiple tabs.
Everything works fine for the first 7 tabs. But on the 8th tab, the server does not respond!
Is it normal? Do you know how to increase this limitation?
I notice you've set
scalaVersion := "2.10.1"
in build.sbt.
This results in
org.scala-lang:scala-library:2.10.1
being included as expected.
However,
org.scala-lang:scala-actors:2.10.0
org.scala-lang:scala-reflect:2.10.0
are not updated, presumably because they are being brought in by the Play framework code that is built with scala 2.10.0.
Is it a good idea to update scalaVersion independently of the Play framework?
Nice sample, thanks!
Running task... Cancelable: false, check cycles: false
Failed: error: exception during sbt task: atmos:run: NullPointerException: null
Any idea what's going on here?
Hi,
I am curious how many concurrent clients you were able to connect to your server. I wrote a express.js (Node) server supporting event source streams and could get up to 3000 clients without optimizations, which seems not that high to me. Also the CPU is maxed out with 3000 clients.
Did you benchmarked it? How does it perform?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.