Esempio n. 1
0
def create_party():
    """
    Crée une partie.
    :return:
    """
    party = Party()
    party.start()
Esempio n. 2
0
def lamport(config_file, node_index):
    nodes = parse_config(config_file)

    clean_log(node_index)

    node = LamportNode(nodes, node_index)
    party = Party(len(nodes))
    try:
        party.start()
        party.enter(node_index)
        while party.is_alive():
            sleep(0.1)

        node.start()

        print("Uploading log")
        upload_log(node_index)
        print("FIN")

    except KeyboardInterrupt:
        party.stop()
        node.stop()