def process_queue(queue, quantity=1, backend='sqlite'):
 event = salt.utils.event.get_event('master', __opts__['sock_dir'], __opts__['transport'], opts=__opts__, listen=False)
 try:
  items = pop(queue=queue, quantity=quantity, backend=backend)
 except SaltInvocationError as exc:
  error_txt = '{0}'.format(exc)
  __jid_event__.fire_event({'errors': error_txt}, 'progress')
  return False
 data = {'items': items, 'backend': backend, 'queue': queue}
 event.fire_event(data, tagify([queue, 'process'], prefix='queue'))

def process_queue ( queue , quantity = 1 , backend = 'sqlite' ) : event = salt . utils . event . get_event ( 'master' , __opts__ [ 'sock_dir' ] , __opts__ [ 'transport' ] , opts = __opts__ , listen = False ) try : items = pop ( queue = queue , quantity = quantity , backend = backend ) except SaltInvocationError as exc : error_txt = '{0}' . format ( exc ) __jid_event__ . fire_event ( { 'errors' : error_txt } , 'progress' ) return False data = { 'items' : items , 'backend' : backend , 'queue' : queue } event . fire_event ( data , tagify ( [ queue , 'process' ] , prefix = 'queue' ) )
pop items off a queue and create an event on the salt event bus to be processed by a reactor .