reset password
Author Message
lbriggs
Posts: 57
Posted 14:59 May 31, 2014 |

I am looking for an example of a Deferred request like the teacher went over in class, but cant seem to find one. Has anyone else had any luck finding references to this kind of action?

armandop
Posts: 32
Posted 16:52 May 31, 2014 |

He uses a Deferred Request.

https://github.com/roghughe/captaindebug/tree/master/long-poll

Also, I took the approach of storing the states in the database (at load this would not scale but works for the homework.  But I dont recommend it) and doing a short poll to check states.  

 

 

 

armandop
Posts: 32
Posted 21:42 May 31, 2014 |

Sorry meant to say that one of the quick ways to tackle this problem is to use a DB but you cant use it in this hw from what i can tell in the description of the assignment.

lbriggs
Posts: 57
Posted 22:39 May 31, 2014 |

Thanks. I ended up sending an ajax request to a controller that holds onto the request with a while loop until another user attempts to join.

armandop
Posts: 32
Posted 22:44 May 31, 2014 |

The good ol' long poll.  Im always skeptical of this approach since itll eat up at resources if nothing comes in but we dont have to worry about such things in this hw.  

Just curious I thought it HAD to be with DeferredRequest. Maybe a question for the Prof.