walkor vor 1 Jahr
Ursprung
Commit
c061242779
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 1
      src/Events/Swoole.php
  2. 0 1
      src/Protocols/Http.php

+ 3 - 1
src/Events/Swoole.php

@@ -212,10 +212,12 @@ final class Swoole implements EventInterface
      */
     public function stop(): void
     {
-        // cancel all coroutines before Event::exit
+        // Cancel all coroutines before Event::exit
         foreach (Coroutine::listCoroutines() as $coroutine) {
             Coroutine::cancel($coroutine);
         }
+        // Wait for coroutines to exit
+        usleep(20000);
         Event::exit();
     }
 

+ 0 - 1
src/Protocols/Http.php

@@ -241,7 +241,6 @@ class Http
         // Read file content from disk piece by piece and send to client.
         $doWrite = function () use ($connection, $handler, $length, $offsetEnd) {
             // Send buffer not full.
-            // @phpstan-ignore-next-line
             while ($connection->context->bufferFull === false) {
                 // Read from disk.
                 $size = 1024 * 1024;