コード例 #1
0
def main():
    """Call threads."""
    global BT
    BT = round(time.time())

    thread1 = sf.Alive(1, "Alive", CONF_FILE)
    thread2 = PubData(2, "PubData")

    thread1.start()
    time.sleep(1)
    thread2.start()
コード例 #2
0
def main():
    """Start all threads."""
    global BT
    BT = round(time.time())

    # Try to connect to catalog by starting Alive process.
    connected = 0
    while connected == 0:
        try:
            thread1 = sf.Alive(1, "Alive", CONF_FILE)
            connected = 1  # Catalog is available
        except Exception:
            print("Catalog is not reachable... retry in 5 seconds")
            time.sleep(5)

    thread2 = PubData(2, "PubData")

    # Start threads.
    thread1.start()
    time.sleep(1)
    thread2.start()