Clean Versions
Browse files
run.py
CHANGED
|
@@ -45,26 +45,22 @@ if __name__ == "__main__":
|
|
| 45 |
|
| 46 |
|
| 47 |
#3. ~~~~ Serve The Flow ~~~~
|
| 48 |
-
serve_utils.
|
| 49 |
cl = cl,
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
default_state=None,
|
| 53 |
-
default_dispatch_point="coflows_dispatch"
|
| 54 |
)
|
| 55 |
|
| 56 |
#4. ~~~~~Start A Worker Thread~~~~~
|
| 57 |
-
run_dispatch_worker_thread(cl
|
| 58 |
|
| 59 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
| 60 |
-
proxy_flow
|
| 61 |
cl=cl,
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
config_overrides=
|
| 65 |
-
|
| 66 |
-
dispatch_point_override=None,
|
| 67 |
-
)
|
| 68 |
|
| 69 |
#6. ~~~ Get the data ~~~
|
| 70 |
data = {"id": 0}
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
#3. ~~~~ Serve The Flow ~~~~
|
| 48 |
+
serve_utils.serve_flow(
|
| 49 |
cl = cl,
|
| 50 |
+
flow_class_name="flow_modules.aiflows.FixedReplyFlowModule.FixedReplyFlow",
|
| 51 |
+
flow_endpoint="FixedReplyFlow",
|
|
|
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
#4. ~~~~~Start A Worker Thread~~~~~
|
| 55 |
+
run_dispatch_worker_thread(cl)
|
| 56 |
|
| 57 |
#5. ~~~~~Mount the flow and get its proxy~~~~~~
|
| 58 |
+
proxy_flow= serve_utils.get_flow_instance(
|
| 59 |
cl=cl,
|
| 60 |
+
flow_endpoint="FixedReplyFlow",
|
| 61 |
+
user_id="local",
|
| 62 |
+
config_overrides = cfg
|
| 63 |
+
)
|
|
|
|
|
|
|
| 64 |
|
| 65 |
#6. ~~~ Get the data ~~~
|
| 66 |
data = {"id": 0}
|