@ -222,9 +222,11 @@ def kill_worker(pid, double_kill, interval=0.5):
class Serializer :
class Serializer :
def loads ( self ) : pass
def loads ( self ) :
pass
def dumps ( self ) : pass
def dumps ( self ) :
pass
def start_worker ( queue_name , conn_kwargs , worker_name , burst ) :
def start_worker ( queue_name , conn_kwargs , worker_name , burst ) :
@ -238,6 +240,7 @@ def start_worker(queue_name, conn_kwargs, worker_name, burst):
w = Worker ( [ queue_name ] , name = worker_name , connection = Redis ( * * conn_kwargs ) )
w = Worker ( [ queue_name ] , name = worker_name , connection = Redis ( * * conn_kwargs ) )
w . work ( burst = burst )
w . work ( burst = burst )
def start_worker_process ( queue_name , connection = None , worker_name = None , burst = False ) :
def start_worker_process ( queue_name , connection = None , worker_name = None , burst = False ) :
"""
"""
Use multiprocessing to start a new worker in a separate process .
Use multiprocessing to start a new worker in a separate process .
@ -248,6 +251,7 @@ def start_worker_process(queue_name, connection=None, worker_name=None, burst=Fa
p . start ( )
p . start ( )
return p
return p
def burst_two_workers ( queue , timeout = 2 , tries = 5 , pause = 0.1 ) :
def burst_two_workers ( queue , timeout = 2 , tries = 5 , pause = 0.1 ) :
"""
"""
Get two workers working simultaneously in burst mode , on a given queue .
Get two workers working simultaneously in burst mode , on a given queue .