Package gluon :: Module scheduler
[hide private]
[frames] | no frames]

Module scheduler

source code

Classes [hide private]
  Task
  TaskReport
  MetaScheduler
  TYPE
validator that check whether field is valid json and validate its type
  Scheduler
Functions [hide private]
 
demo_function(*argv, **kwargs)
test function
source code
 
_decode_list(lst) source code
 
_decode_dict(dct) source code
 
executor(queue, task, out)
the background process
source code
 
main()
allows to run worker without python web2py.py ....
source code
Variables [hide private]
  USAGE = '\n## Example\n\nFor any existing app\n\nCreate File: ...
  path = '/home/mdipierro/make_web2py/web2py'
  IDENTIFIER = 'giles-liveconsole3#28586'
  logger = logging.getLogger('web2py.scheduler.%s' % IDENTIFIER)
  QUEUED = 'QUEUED'
  ASSIGNED = 'ASSIGNED'
  RUNNING = 'RUNNING'
  COMPLETED = 'COMPLETED'
  FAILED = 'FAILED'
  TIMEOUT = 'TIMEOUT'
  STOPPED = 'STOPPED'
  ACTIVE = 'ACTIVE'
  TERMINATE = 'TERMINATE'
  DISABLED = 'DISABLED'
  KILL = 'KILL'
  PICK = 'PICK'
  STOP_TASK = 'STOP_TASK'
  EXPIRED = 'EXPIRED'
  SECONDS = 1
  HEARTBEAT = 3
  MAXHIBERNATION = 10
  CLEAROUT = '!clear!'
  CALLABLETYPES = (<type 'function'>, <type 'function'>, <type '...
  TASK_STATUS = ('QUEUED', 'RUNNING', 'COMPLETED', 'FAILED', 'TI...
  RUN_STATUS = ('RUNNING', 'COMPLETED', 'FAILED', 'TIMEOUT', 'ST...
  WORKER_STATUS = ('ACTIVE', 'PICK', 'DISABLED', 'TERMINATE', 'K...
  __package__ = 'gluon'
Function Details [hide private]

main()

source code 

allows to run worker without python web2py.py .... by simply python this.py


Variables Details [hide private]

USAGE

Value:
'''
## Example

For any existing app

Create File: app/models/scheduler.py ======
from gluon.scheduler import Scheduler

...

CALLABLETYPES

Value:
(<type 'function'>,
 <type 'function'>,
 <type 'builtin_function_or_method'>,
 <type 'instancemethod'>,
 <type 'builtin_function_or_method'>)

TASK_STATUS

Value:
('QUEUED',
 'RUNNING',
 'COMPLETED',
 'FAILED',
 'TIMEOUT',
 'STOPPED',
 'EXPIRED')

RUN_STATUS

Value:
('RUNNING', 'COMPLETED', 'FAILED', 'TIMEOUT', 'STOPPED')

WORKER_STATUS

Value:
('ACTIVE', 'PICK', 'DISABLED', 'TERMINATE', 'KILL', 'STOP_TASK')