def main_process(my_id):
    config_params = ConfigReader().parse_vars(
        ["RECV_QUEUE",
        "SEND_QUEUE",
        "MASTER_SEND_QUEUE",
        "SEND_REQUEST_QUEUE",
        "STATUS_QUEUE",
        "DATA_CLUSTER_WRITE",
        "DATA_CLUSTER_READ"
        ]
    )

    worker = Worker(
        config_params["RECV_QUEUE"],
        [config_params["SEND_QUEUE"]],
        config_params["MASTER_SEND_QUEUE"],
        config_params["SEND_REQUEST_QUEUE"],
        config_params["STATUS_QUEUE"],
        config_params["DATA_CLUSTER_WRITE"],
        config_params["DATA_CLUSTER_READ"],
        my_id
    )
    
    while True:
        worker.start()
Esempio n. 2
0
def main():
    config_params = ConfigReader().parse_vars(
        ["RECV_QUEUE", "SEND_QUEUE", "MASTER_SEND_QUEUE"])

    worker = Worker(config_params["RECV_QUEUE"], [config_params["SEND_QUEUE"]],
                    config_params["MASTER_SEND_QUEUE"])

    worker.start()
def main_process():
    config_params = ConfigReader().parse_vars([
        "RECV_QUEUE", "SEND_QUEUE", "STATUS_QUEUE", "DATA_CLUSTER_WRITE",
        "DATA_CLUSTER_READ"
    ])

    worker = Worker(config_params["RECV_QUEUE"], config_params["SEND_QUEUE"],
                    config_params["STATUS_QUEUE"],
                    config_params["DATA_CLUSTER_WRITE"],
                    config_params["DATA_CLUSTER_READ"])

    worker.start()
eel.initJs(width)  # Call a Javascript function


def webServer():
    eel.start('main.html', block=False)  # Start (this blocks and enters loop)
    while True:
        eel.sleep(1.0)  # Use eel.sleep(), not time.sleep()


try:
    _thread.start_new_thread(webServer, ())  # launch the server in parallel
    print("webServer started !")
except:
    print("Error: unable to start thread")

if __name__ == "__main__":
    # We create our senders
    maze = PyramidalMaze(width)
    scout1 = Scout("*****@*****.**", "woweygiowa96")
    engineer1 = Engineer("*****@*****.**", "woweygiowa96")
    worker1 = Worker("*****@*****.**", "woweygiowa96")

    scout1.constructor(maze, eel)
    scout1.start()

    engineer1.constructor(maze, eel)
    engineer1.start()

    worker1.constructor(maze, eel)
    worker1.start()
Esempio n. 5
0
from flask import Flask
from flask import render_template
import logging

from utils.config import Config
from utils.common import create_folder, get_folder, init_usign

app = Flask(__name__)

import server.views

config = Config()
create_folder("{}/{}".format(get_folder("downloaddir"), "faillogs"))
if config.get("sign_images"):
    print("sign images")
    init_usign()

if config.get("dev"):
    from worker.worker import Worker
    worker = Worker()
    worker.start()
    #app.debug = True