FatFractal customer forums



Author Topic: Long Polling, or Something  (Read 1611 times)

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Long Polling, or Something
« on: March 08, 2014, 07:15:39 PM »
The project I'm working on has a producer/consumer thing going on, where a producer app creates content that should quickly appear in the consumer app.  My initial plan was to send a push notification to the consumer whenever there was new content, but that falls short of my requirements.

A producer should know, before creating content, whether its target consumer is online.  My first thought was to have the consumer poll the server regularly, updating a "lastPolled" date field that the producer can then test to see if the consumer is active.  That led to a train of thought like this:

As long as the consumer is polling anyway, the content to be retrieved from that same sever call.  Then when the producer gets the push notification, it simply polls right away, gets the content, and resets the polling timer.  I wonder if FatFractal extensions support long polling, which could eliminate the need for push notifications altogether.  Or some kind of web sockets deal.  Or ... (thoughts trail off into the distance)

So: can FatFractal extensions support long polling?  Or do you have some other awesome idea to handle this?

Eric

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
Re: Long Polling, or Something
« Reply #1 on: March 08, 2014, 07:33:13 PM »
It may be worth pointing out: I've seen that RingoJS has support for both long polling (http://hns.github.io/2010/07/02/versatility.html) and web sockets (http://ringojs.org/api/v0.10/ringo/httpserver/#WebSocket).  However, I do not immediately see how to incorporate either of those ideas into a FatFractal NoServer extension, so that I get the magic of the user object, returning javascript objects that magically turn into the correct type of object in the client SDKs, etc.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Long Polling, or Something
« Reply #2 on: March 08, 2014, 08:53:11 PM »
Hi Eric

We don't support long polling at the moment. We do have websockets support in our roadmap which will support exactly this type of producer/consumer behaviour.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Long Polling, or Something
« Reply #3 on: March 08, 2014, 08:58:43 PM »
In the short term, using push notifications to let the client know there is something to retrieve, is the way most people handle this

 

Copyright © FatFractal customer forums