Author Topic: Cron alternative supporting seconds  (Read 833 times)

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Cron alternative supporting seconds
« on: July 10, 2009, 06:45:02 AM »
I saw news about an update to the game Pardus. It announced the release of Secrond, an implementation of cron that allows you to schedule down to the second.

Depending on your gameplay, it could be easier than setting up a script to check the time and sleep until the next event.

https://launchpad.net/secrond

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Qwerty

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #1 on: July 10, 2009, 06:56:42 AM »
...

What?
- "I sentance you to life"
- "You moron I'm already alive"

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Cron alternative supporting seconds
« Reply #2 on: July 10, 2009, 09:23:36 AM »
What?
Standard CRON only allows you to schedule scripts to be run at a particular minute. IE: July 30th, 2009 at 12:00 PM. However, Secrond will allow you to run a script at any particular second. IE: July 30th, 2009 at 12:00:15 PM. Which is 15 seconds later than the other cron time.

The current method around CRON's limitation is to have your script sleep() for 15 seconds. It could simplify a developer's life to have the task actually carried out at the appropriate time instead of needing to rely on sleeping scripts.

Thanks for the post Harkins.
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Barrikor

  • Level 21
  • *
  • Posts: 248
  • Reputation: +3/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #3 on: July 10, 2009, 12:16:59 PM »
Bookmarked it :)

Projects: Pith Framework (at 0.5), CactusGUI (at 0.3)

Offline Qwerty

  • Level 12
  • *
  • Posts: 90
  • Reputation: +0/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #4 on: July 10, 2009, 07:53:33 PM »
Ok. I didn't know that because I don't use CRON.
- "I sentance you to life"
- "You moron I'm already alive"

Offline zykal

  • Level 9
  • *
  • Posts: 54
  • Reputation: +0/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #5 on: July 13, 2009, 03:48:59 PM »
definitely a nice improvement, but I fail to see how seriously helpful it is to be able to run it at the second level rather then the minute. What would be so important that it'd have to run 15 seconds later? I'm sure there are things but they escape my thought process.

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Cron alternative supporting seconds
« Reply #6 on: July 13, 2009, 04:51:04 PM »
What would be so important that it'd have to run 15 seconds later?
A system could be created (not necessarily recommended, but, theoretically, possible) that would allow crontabs to be created to run a script at any specified second. In essence, say you have a game that allows 'building' or 'training' of some game statistic that completes after a specified period of 'real-time.' You can now crontab this instead of using another method (such as database timestamp or what-not).

As I said, not really sure of any recommendations for this at the moment. But the next time I need to configure a script to run a few seconds after some other script (perhaps because all resources are being allocated by some monster process at that time) I'll be thankful for having seen this at some point in time. :)
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Sagefire135

  • Level 14
  • *
  • Posts: 107
  • Reputation: +2/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #7 on: July 13, 2009, 05:28:51 PM »
I can see this being really useful for a tick reset or something in a game that has alot of players. instead of having one reset that works for everyone, it coudl be split into sections every 30 seconds lightening the load on the server but still getting it done quickly.

cant say ive ever used cron or looked into server useage, but i imagine its never a bad idea to give the server a break every once in a while.

Offline zykal

  • Level 9
  • *
  • Posts: 54
  • Reputation: +0/-0
    • View Profile
Re: Cron alternative supporting seconds
« Reply #8 on: July 13, 2009, 05:39:54 PM »
Ahh yes I didn't think of that, now that you mention it setting crons up in groups for large processing makes sense now.


I knew i just wasn't seeing it.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal