def main(port, address):
    rebuild_timer_and_queue()
    
    putter_thread = RunningPutter()
    putter_thread.start()
    
    add_callback(update_nginx_host)
    
    app = iApplication()
    app.listen(port, address=address)
    ioloop.IOLoop.instance().start()
Beispiel #2
0
def main(port, address):
    rebuild_timer_and_queue()

    putter_thread = RunningPutter()
    putter_thread.start()

    add_callback(update_nginx_host)

    app = iApplication()
    app.listen(port, address=address)
    ioloop.IOLoop.instance().start()
Beispiel #3
0
    
    message_final = {
        "message_id": msg_id,
        "message_type": "task",
        "command": "addhost",
        "content": message
    }
    
    driver = NginxDriver(logger=LOG)
    ret, why = driver.add_host(message_final)
    if ret == True:
        data = dict(
            msg_id = msg_id,
            msg_type = "result",
            node_id = server_node_id,
            target_host = src_host,
            target_port = src_port
        )
        processor.process_send(data)


if __name__ == '__main__':
    processor.process_request.callback = request_handler
    
    heartbeat = HeartBeat()
    heartbeat.start()
    
    add_callback(callback)
    ioloop.IOLoop.instance().start()

Beispiel #4
0
        "host_type": "tcp",
        "original": kwargs
    }

    message_final = {
        "message_id": msg_id,
        "message_type": "task",
        "command": "addhost",
        "content": message
    }

    driver = NginxDriver(logger=LOG)
    ret, why = driver.add_host(message_final)
    if ret == True:
        data = dict(msg_id=msg_id,
                    msg_type="result",
                    node_id=server_node_id,
                    target_host=src_host,
                    target_port=src_port)
        processor.process_send(data)


if __name__ == '__main__':
    processor.process_request.callback = request_handler

    heartbeat = HeartBeat()
    heartbeat.start()

    add_callback(callback)
    ioloop.IOLoop.instance().start()