Clean Versions
Browse files
run.py
CHANGED
@@ -18,8 +18,6 @@ from aiflows.interfaces import KeyInterface
|
|
18 |
from aiflows.utils.colink_utils import start_colink_server
|
19 |
from aiflows.workers import run_dispatch_worker_thread
|
20 |
|
21 |
-
CACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching
|
22 |
-
# clear_cache() # Uncomment this line to clear the cache
|
23 |
|
24 |
logging.set_verbosity_debug()
|
25 |
|
@@ -58,26 +56,22 @@ if __name__ == "__main__":
|
|
58 |
|
59 |
|
60 |
#3. ~~~~ Serve The Flow ~~~~
|
61 |
-
serve_utils.
|
62 |
cl = cl,
|
63 |
-
|
64 |
-
|
65 |
-
default_state=None,
|
66 |
-
default_dispatch_point="coflows_dispatch"
|
67 |
)
|
68 |
|
69 |
#4. ~~~~~Start A Worker Thread~~~~~
|
70 |
run_dispatch_worker_thread(cl, dispatch_point="coflows_dispatch", flow_modules_base_path=FLOW_MODULES_PATH)
|
71 |
|
72 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
73 |
-
proxy_flow
|
74 |
cl=cl,
|
75 |
-
|
76 |
-
|
77 |
-
config_overrides=
|
78 |
-
|
79 |
-
dispatch_point_override=None,
|
80 |
-
)
|
81 |
|
82 |
#6. ~~~ Get the data ~~~
|
83 |
data = {"id": 0}
|
|
|
18 |
from aiflows.utils.colink_utils import start_colink_server
|
19 |
from aiflows.workers import run_dispatch_worker_thread
|
20 |
|
|
|
|
|
21 |
|
22 |
logging.set_verbosity_debug()
|
23 |
|
|
|
56 |
|
57 |
|
58 |
#3. ~~~~ Serve The Flow ~~~~
|
59 |
+
serve_utils.serve_flow(
|
60 |
cl = cl,
|
61 |
+
flow_class_name="flow_modules.aiflows.FlowModule.NAMEHERE",
|
62 |
+
flow_endpoint="FlowModule",
|
|
|
|
|
63 |
)
|
64 |
|
65 |
#4. ~~~~~Start A Worker Thread~~~~~
|
66 |
run_dispatch_worker_thread(cl, dispatch_point="coflows_dispatch", flow_modules_base_path=FLOW_MODULES_PATH)
|
67 |
|
68 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
69 |
+
proxy_flow= serve_utils.get_flow_instance(
|
70 |
cl=cl,
|
71 |
+
flow_endpoint="FlowModule",
|
72 |
+
user_id="local",
|
73 |
+
config_overrides = cfg
|
74 |
+
)
|
|
|
|
|
75 |
|
76 |
#6. ~~~ Get the data ~~~
|
77 |
data = {"id": 0}
|