Exemplo n.º 1
0
 def test_process_queue(self):
     connect('test', func_handler)
     event_dict = {'args1': 1, 'arg2':2}
     post('test', **event_dict)
     post('test', event_dict)
     process_queue()
     self.failUnlessEqual(event_dict, Q.popleft())
     self.failUnlessEqual(event_dict, Q.popleft())
Exemplo n.º 2
0
def run(args):
    ''' Main loop for the client '''
    post('join', host=HOST, port=PORT)
    stop = False
    while not stop:
        post('tick')
        stop = process_queue()
        asyncore.poll(0.002)
Exemplo n.º 3
0
def run(args):
    ''' Main loop for the server '''
    GAME.load_from_files(args.board)
    stop = False
    while not stop:
        post('tick')
        stop = process_queue()
        asyncore.poll(0.01)