On Aug 16, 2011, at 10:00 AM, Jim Ruther Nill <[email protected]> wrote:

> 
> 
> On Tue, Aug 16, 2011 at 9:04 PM, Genji <[email protected]> wrote:
> Thank you for the answers.
> 
> Using a scheduler or a external cron service still means to use a
> worker, right?
> But would the "js - way" need a worker for that task? (js means java
> script or not?)
> The problem is just that i never did something with javascript...
> So maybe i could set it up like Jim said and using the rufus-scheduler
> in place of js (https://github.com/jmettraux/rufus-scheduler )?
> But there is one question left.
> Would this be more productive? I still have to check every user to
> know who is logged in and who is not. Would java script change this?
> Right now it would be:
> one process for all users -- long running
> would java script change it to :
> one process for one user without a background worker?
> 
> btw: Cronjob sounds great for checking the points of the players...
> 
> 
> The main reason I suggested using js is so that the user's view will
> always be updated and/or correct.  Having a background job do the
> updates will only update the database.  The user still has to refresh
> the page to get the current amount of resources.  Or you'd still have
> to update the page via ajax so that the values are updated.
> 
> To answer your question, a js will at most send 1 request to your server
> every hour, which is much more acceptable than sending a request to
> the server every minute just so that the server can update the resources'
> values via ajax.

One thing to keep in mind with the JavaScript method is that if a person wants 
to cheat they may be able to fake extra js requests.  For multiplayer this may 
be a problem.  Easily handled with a little extra checking on the server when 
the requests come in, though.

-r

> On 16 Aug., 11:37, Jigar Patel <[email protected]> wrote:
> > Create an endpoint and call it using external cron service.
> >
> > http://www.setcronjob.com/
> >
> > --
> > Posted viahttp://www.ruby-forum.com/.
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> 
> 
> 
> -- 
> -------------------------------------------------------------
> visit my blog at http://jimlabs.heroku.com
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to