Skip to content

Commit a05f2af

Browse files
committed
Take advantage of the integrated termination process.
We now use the termination process f pyfunceble-process-manager instead of trying control it ourselves.
1 parent 7d1cf3c commit a05f2af

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

PyFunceble/cli/system/launcher.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,10 +1090,16 @@ def stop_and_wait_for_all_manager(self) -> "SystemLauncher":
10901090
Sends our stop signal and wait until all managers are finished.
10911091
"""
10921092

1093-
# The idea out here is to propate the stop signal.
1094-
# Meaning that the tester will share it's stop signal to all
1095-
# subsequencial queues after all submitted tasks are done.
1096-
self.tester_process_manager.push_stop_signal(source_worker="main")
1093+
# We start the termination process of the tester.
1094+
#
1095+
# Please note that we do not explicitly wait for the tester to terminate
1096+
# through the `wait` method. The reason is that the `terminate` method
1097+
# will wait for the tester to finish before terminating itself.
1098+
#
1099+
# Please also note that any process depending on the tester will be
1100+
# terminated after the tester is done because we are setting the
1101+
# `spread_stop_signal` # attribute to `True` (cf: see __init__ method).
1102+
self.tester_process_manager.terminate()
10971103

10981104
if self.miner_process_manager:
10991105
self.miner_process_manager.wait()
@@ -1105,8 +1111,7 @@ def stop_and_wait_for_all_manager(self) -> "SystemLauncher":
11051111
# From here, we are sure that every test and files are produced.
11061112
# We now format the generated file(s).
11071113
self.dir_files_sorter_process_manager.start()
1108-
self.dir_files_sorter_process_manager.push_stop_signal()
1109-
self.dir_files_sorter_process_manager.wait()
1114+
self.dir_files_sorter_process_manager.terminate()
11101115
except AssertionError:
11111116
# Example: Already started previously.
11121117
pass

PyFunceble/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
from PyFunceble.storage_facility import get_config_directory
6161

6262
PROJECT_NAME: str = "PyFunceble"
63-
PROJECT_VERSION: str = "4.3.0a17.dev (Blue Duckling: Tulip)"
63+
PROJECT_VERSION: str = "4.3.0a18.dev (Blue Duckling: Tulip)"
6464

6565
DISTRIBUTED_CONFIGURATION_FILENAME: str = ".PyFunceble_production.yaml"
6666

docs/develop/examples/file-generation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ for domain in DOMAINS:
101101
producer_proc.push_stop_signal()
102102

103103
# Now we wait until it's done.
104-
producer_proc.wait()
104+
producer_proc.terminate()
105105

106106
# From here all files were generated we can do whatever we want with them.
107107
```

examples/api_usage/file_generation.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,8 @@
9090
(communication_dataset, test_result)
9191
)
9292

93-
# We are now done, it's time to send the stop signal.
94-
# The stop signal will inform thhe producer thread that it needs to stop
95-
# listening to new order (from the time it reads the stop signal).
96-
producer_process_manager.push_stop_signal(source_worker="main")
97-
98-
# Now we wait until it's done.
99-
producer_process_manager.wait()
93+
# We are now done, it's time to wait and shutdown.
94+
producer_process_manager.terminate()
10095

10196
# From here all files were generated we can do whatever we want with them.
10297

version.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
current_version: '4.3.0a17.dev (Blue Duckling: Tulip)'
1+
current_version: '4.3.0a18.dev (Blue Duckling: Tulip)'
22
deprecated:
33
- 3.0.21
44
- 3.1.20

0 commit comments

Comments
 (0)