def serviceRoads(stacks, duration=1.0):
 start = time.time()
 while ((start + duration) > time.time()):
  for stack in stacks:
   stack.serviceAll()
  if all([(not stack.transactions) for stack in stacks]):
   console.terse('Service stacks done normally\n')
   break
  time.sleep(0.05)
 for stack in stacks:
  console.terse('Stack {0} remotes: {1}\n'.format(stack.name, stack.nameRemotes))
 console.terse('Service stacks exit\n')

def serviceRoads ( stacks , duration = 1.0 ) : start = time . time ( ) while ( ( start + duration ) > time . time ( ) ) : for stack in stacks : stack . serviceAll ( ) if all ( [ ( not stack . transactions ) for stack in stacks ] ) : console . terse ( 'Service stacks done normally\n' ) break time . sleep ( 0.05 ) for stack in stacks : console . terse ( 'Stack {0} remotes: {1}\n' . format ( stack . name , stack . nameRemotes ) ) console . terse ( 'Service stacks exit\n' )
utility method to service queues for list of stacks .