File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 14
14
import sys
15
15
16
16
17
- def invoke_main ():
17
+ async def main ():
18
+ await bootstrap_main ()
19
+
20
+
21
+ def invoke_main () -> None :
18
22
# if this is invoked with the stdout piped somewhere, then print
19
23
# changes its buffering behavior. So we default to the standard
20
24
# behavior of std out as if it were a terminal.
21
25
sys .stdout .reconfigure (line_buffering = True )
26
+ global bootstrap_main
22
27
# TODO: figure out what from worker_main.py we should reproduce here.
23
28
from monarch ._rust_bindings .monarch_hyperactor .bootstrap import bootstrap_main
24
29
@@ -30,8 +35,9 @@ def invoke_main():
30
35
# fallback to using local py-spy
31
36
32
37
# Start an event loop for PythonActors to use.
33
- asyncio .run (bootstrap_main ())
38
+ asyncio .run (main ())
34
39
35
40
36
41
if __name__ == "__main__" :
42
+ # Do not add code here, it won't be run. Add them to the function called below.
37
43
invoke_main () # pragma: no cover
You can’t perform that action at this time.
0 commit comments