-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
39 lines (31 loc) · 989 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from collections.abc import Sequence
from rich.traceback import install
from src.environment import generator
from src.logger import setup_logging
from src.orders import order_planner
from src.path_planning import process as path_planning
from src.runner import (
Process,
get_process_executor,
setup_message_bus,
start_processes,
supervise_processes,
)
install(show_locals=True)
setup_logging(name="root")
def main():
processes: Sequence[Process] = (
generator.get_process(),
path_planning.get_process(),
order_planner.get_process(),
)
with get_process_executor() as executor:
with setup_message_bus(executor) as message_bus:
process_futures = start_processes(executor, processes, message_bus)
supervise_processes(
executor=executor,
process_futures=process_futures,
message_bus=message_bus,
)
if __name__ == "__main__":
main()