mattbowen / akka-web-template

A sbt-based, scala Akka project that sets up a web project with REST and comet support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Comet: how?

wpietri opened this issue · comments

Hi! Being a noob, I'm stuck on something that I'm sure is obvious to you. How do I go from your RESTful example to a Comet interaction? A couple lines in the docs or a bit more sample code would be a big help.

Thanks!

Hey there,

Thank you for the suggestion, but this isn't really a bug. The goal of this project is just to give people a base to work from. I'm swamped with work right now, but if I can I'll try to add something beyond the hello world that has something comet-related in it. I can't make any promises though. In the meantime, I'd look at

http://github.com/jboner/akka/blob/master/akka-samples/akka-sample-rest-scala/src/main/scala/SimpleService.scala

That's the example akka-rest project -- look at the Chat class, which has an @suspend annotation. That's the key to comet support. You might also want to read a little bit of the docs for atmosphere

https://atmosphere.dev.java.net/

Which is what's used under the covers for comet support.

Thanks! I'll check those links out.

If I get something useful, I'll definitely submit a patch. And yes, I agree this isn't a bug; I just couldn't figure out how else to suggest improvements.