Skip to content

Instantly share code, notes, and snippets.

@evnpr
Created February 21, 2013 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evnpr/5000947 to your computer and use it in GitHub Desktop.
Save evnpr/5000947 to your computer and use it in GitHub Desktop.
poll function in server
def poll
last_post = params[:last_post]
def check
r = Post.all.order(:created_at => "ASC").last
if r.message != last_post
return true
else
return false
end
end
while check == false
//no need to do anything
end
//send json to be used on front end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment