@@ 75-85 (lines=11) @@ | ||
72 | await mystatemachine.change_state(state1, trans1, f"{mystatemachine._name}: Idle", 300) |
|
73 | ||
74 | async with server: |
|
75 | while 1: |
|
76 | await asyncio.sleep(2) |
|
77 | await mystatemachine.change_state(state2, trans2, f"{mystatemachine._name}: Loading", 350) |
|
78 | await asyncio.sleep(2) |
|
79 | await mystatemachine.change_state(state3, trans3, f"{mystatemachine._name}: Initializing", 400) |
|
80 | await asyncio.sleep(2) |
|
81 | await mystatemachine.change_state(state4, trans4, f"{mystatemachine._name}: Processing", 600) |
|
82 | await asyncio.sleep(2) |
|
83 | await mystatemachine.change_state(state5, trans5, f"{mystatemachine._name}: Finished", 800) |
|
84 | await asyncio.sleep(2) |
|
85 | await mystatemachine.change_state(state1, trans1, f"{mystatemachine._name}: Idle", 500) |
|
86 | ||
87 | asyncio.run(main()) |
|
88 |
@@ 62-72 (lines=11) @@ | ||
59 | await mystatemachine2.change_state(sm2state1) |
|
60 | ||
61 | async with server: |
|
62 | while 1: |
|
63 | await asyncio.sleep(2) |
|
64 | await mystatemachine.change_state(state2, trans2, f"{mystatemachine._name}: Loading", 350) |
|
65 | await asyncio.sleep(2) |
|
66 | await mystatemachine.change_state(state3, trans3, f"{mystatemachine._name}: Initializing", 400) |
|
67 | await asyncio.sleep(2) |
|
68 | await mystatemachine.change_state(state4, trans4, f"{mystatemachine._name}: Processing", 600) |
|
69 | await asyncio.sleep(2) |
|
70 | await mystatemachine.change_state(state5, trans5, f"{mystatemachine._name}: Finished", 800) |
|
71 | await asyncio.sleep(2) |
|
72 | await mystatemachine.change_state(state1, trans1, f"{mystatemachine._name}: Idle", 500) |
|
73 | ||
74 | asyncio.run(main()) |
|
75 |