@@ -105,15 +105,9 @@ private function processFiber(): void
105105 $ pendingRequests = $ this ->getPendingRequests ($ this ->sessionId );
106106
107107 if (empty ($ pendingRequests )) {
108- // Flush any queued messages before resuming (e.g., notifications from previous yield)
109- $ this ->flushOutgoingMessages ();
110-
111108 $ yielded = $ this ->sessionFiber ->resume ();
112109 $ this ->handleFiberYield ($ yielded , $ this ->sessionId );
113110
114- // Flush newly queued messages (like notifications) before returning
115- $ this ->flushOutgoingMessages ();
116-
117111 return ;
118112 }
119113
@@ -127,7 +121,6 @@ private function processFiber(): void
127121 if (null !== $ response ) {
128122 $ yielded = $ this ->sessionFiber ->resume ($ response );
129123 $ this ->handleFiberYield ($ yielded , $ this ->sessionId );
130- $ this ->flushOutgoingMessages ();
131124
132125 return ;
133126 }
@@ -136,7 +129,6 @@ private function processFiber(): void
136129 $ error = Error::forInternalError ('Request timed out ' , $ requestId );
137130 $ yielded = $ this ->sessionFiber ->resume ($ error );
138131 $ this ->handleFiberYield ($ yielded , $ this ->sessionId );
139- $ this ->flushOutgoingMessages ();
140132
141133 return ;
142134 }
@@ -171,7 +163,6 @@ private function flushOutgoingMessages(): void
171163 private function writeLine (string $ payload ): void
172164 {
173165 fwrite ($ this ->output , $ payload . \PHP_EOL );
174- fflush ($ this ->output );
175166 }
176167
177168 public function close (): void
0 commit comments