File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1919use Hyperf \AsyncQueue \Exception \InvalidPackerException ;
2020use Hyperf \AsyncQueue \MessageInterface ;
2121use Hyperf \Contract \PackerInterface ;
22+ use Hyperf \Process \ProcessManager ;
2223use Hyperf \Utils \Arr ;
2324use Hyperf \Utils \Coroutine \Concurrent ;
2425use Hyperf \Utils \Packer \PhpSerializerPacker ;
2728
2829abstract class Driver implements DriverInterface
2930{
30- /**
31- * @var bool
32- * @deprecated v2.1 use ProcessManager::isRunning() instead.
33- */
34- public static $ running = true ;
35-
3631 /**
3732 * @var ContainerInterface
3833 */
@@ -85,7 +80,7 @@ public function consume(): void
8580 $ messageCount = 0 ;
8681 $ maxMessages = Arr::get ($ this ->config , 'max_messages ' , 0 );
8782
88- while (self :: $ running ) {
83+ while (ProcessManager:: isRunning () ) {
8984 [$ data , $ message ] = $ this ->pop ();
9085
9186 if ($ data === false ) {
Original file line number Diff line number Diff line change 1111 */
1212namespace Hyperf \AsyncQueue \Signal ;
1313
14- use Hyperf \AsyncQueue \ Driver \ Driver ;
14+ use Hyperf \Process \ ProcessManager ;
1515use Hyperf \Signal \SignalHandlerInterface ;
1616
17+ /**
18+ * @deprecated v2.2 use Hyperf\Process\Handler\ProcessStopHandler instead.
19+ */
1720class DriverStopHandler implements SignalHandlerInterface
1821{
1922 public function listen (): array
@@ -25,6 +28,6 @@ public function listen(): array
2528
2629 public function handle (int $ signal ): void
2730 {
28- Driver:: $ running = false ;
31+ ProcessManager:: setRunning ( false ) ;
2932 }
3033}
You can’t perform that action at this time.
0 commit comments