@gen.engine
def Dispatch(client, callback):
 job = Job(client, 'dbchk')
 if options.options.require_lock:
  got_lock = (yield gen.Task(job.AcquireLock))
  if (got_lock == False):
   logging.warning('Failed to acquire job lock: exiting.')
   callback()
   return
 try:
  (yield gen.Task(RunOnce, client, job))
 finally:
  (yield gen.Task(job.ReleaseLock))
 callback()

@ gen . engine def Dispatch ( client , callback ) : job = Job ( client , 'dbchk' ) if options . options . require_lock : got_lock = ( yield gen . Task ( job . AcquireLock ) ) if ( got_lock == False ) : logging . warning ( 'Failed to acquire job lock: exiting.' ) callback ( ) return try : ( yield gen . Task ( RunOnce , client , job ) ) finally : ( yield gen . Task ( job . ReleaseLock ) ) callback ( )
dispatches according to command-line options .