Use lift comet capabilities outside of the browser

52 views
Skip to first unread message

Maxime Brugidou

unread,
Nov 18, 2010, 1:36:18 PM11/18/10
to lif...@googlegroups.com
Hi,

I am very new to scala/lift but I must say that I am very impressed by the ajax/comet capabilities built-in. It does make web developers' life easy. I am playing around with CometActor and other things and looking at how the javascript is generated and sent back to the browser. I also noted the the "cometAjax.js" dead-simple implementation. I have questions about this setup:

- Is this "comet" server compatible with the bayeux protocol? It seems to me that it's not and that what lift calls comet is just ajax + long-polling.
- How could I get a non-browser client use the /comet_request/XX/sessionid requests? I am thinking about a java client (Android app). I guess I would need to override a bunch of stuff generating the response but I'm a little lost here.

I am trying to have a comet enabled website AND mobile apps using the comet capabilities.

Cheers,
Maxime

David Pollak

unread,
Nov 18, 2010, 1:56:56 PM11/18/10
to lif...@googlegroups.com
On Thu, Nov 18, 2010 at 10:36 AM, Maxime Brugidou <maxime....@gmail.com> wrote:
Hi,

I am very new to scala/lift but I must say that I am very impressed by the ajax/comet capabilities built-in. It does make web developers' life easy. I am playing around with CometActor and other things and looking at how the javascript is generated and sent back to the browser. I also noted the the "cometAjax.js" dead-simple implementation. I have questions about this setup:

- Is this "comet" server compatible with the bayeux protocol?

No.  There are problems with the Bayeux protocol (it doesn't deal well with multiple components per page) and Bayeux was developed after we developed the Lift comet protocol.
 
It seems to me that it's not and that what lift calls comet is just ajax + long-polling.

Lift's current comet implementation (and Bayeux's comet) is just long polling.  But Lift's comet abstraction does not require that implementation.  Once web sockets get sorted out and are broadly and uniformly supported (broadly == Firefox/Chrome/Safari), we'll add web sockets autodetect to Lift and Lift's comet will use web sockets on browsers that support them.
 
- How could I get a non-browser client use the /comet_request/XX/sessionid requests? I am thinking about a java client (Android app). I guess I would need to override a bunch of stuff generating the response but I'm a little lost here.

Lift has support for long polling against REST requests... see http://www.assembla.com/wiki/show/liftweb/Asynchronous_REST_API_support


 

I am trying to have a comet enabled website AND mobile apps using the comet capabilities.

If you open a ticket at http://ticket.liftweb.net (you need to be a watcher of the Liftweb space on assembla), I'll work on example code to demonstrate how to share an Actor between CometActor and REST with long polling, so you have 1 piece of business logic, but delivery via HTML and delivery via REST.
 

Cheers,
Maxime

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Maxime Brugidou

unread,
Nov 18, 2010, 2:20:34 PM11/18/10
to lif...@googlegroups.com
Thanks for answering. Asynchronous REST is definitely what I need, I don't know why I was focusing on the "comet/bayeux" stuff.

I would probably open a ticket later if i can't get CometActor and Asynchronous REST together, and I would love to see web sockets on lift :)

Maxime

Maxime Brugidou

unread,
Nov 23, 2010, 8:57:34 AM11/23/10
to lif...@googlegroups.com
Hi David,


If you have a good example that would help me a lot, I tried mutltiple things but it's quite ugly (using a future and maintaining a Map of actors...)

Thanks a lot,

Maxime
Reply all
Reply to author
Forward
0 new messages