i have 2 python application timer driven. these applications gets executed @ every fixed interval of time. code driven timers driven this:
while true: do_something() sleep(10)
i have few questions:
- the application needs executed periodically. above stated way correct ?
- does needed daemonize these sort of applications or running in background of tools upstart ok ? how these 2 approaches different ?
- if have more 1 application on single machine (consider multi core cpu ) how these applications going get system resources during execution?
- what happen if cpu busy executing other tasks , meanwhile timer expires these applications, whetherthe job running on cpu preempted or depend on nature of job. if job non-preemptive , understanding goes job queued processing. if case , how make application run @ every definite time interval.
celery industry standard delayed , periodic tasks.
benefits using celery is:
- you can control , prevent tasks overlapping
- your tasks manage code not os
- and many more periodic tasks can view celery pereodic task