File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1212use Aternos \Taskmaster \Communication \Socket \Exception \SocketWriteException ;
1313use Aternos \Taskmaster \Communication \Socket \SelectableSocketInterface ;
1414use Aternos \Taskmaster \Communication \Socket \SocketCommunicatorTrait ;
15+ use Aternos \Taskmaster \Communication \StdStreams ;
1516use Aternos \Taskmaster \Runtime \AsyncRuntimeInterface ;
1617use Aternos \Taskmaster \Taskmaster ;
1718use Aternos \Taskmaster \Worker \Instance \ProxyableWorkerInstanceInterface ;
@@ -244,7 +245,7 @@ protected function handleFail(null|string|Exception $reason = null): static
244245 if ($ reason instanceof Exception) {
245246 $ reason = $ reason ->getMessage ();
246247 }
247- fwrite (STDERR , "Proxy runtime failed: " . $ reason . PHP_EOL );
248+ fwrite (StdStreams:: getInstance ()-> getStderr () , "Proxy runtime failed: " . $ reason . PHP_EOL );
248249 exit (1 );
249250 }
250- }
251+ }
Original file line number Diff line number Diff line change 88use Aternos \Taskmaster \Communication \Socket \Socket ;
99use Aternos \Taskmaster \Communication \Socket \SocketCommunicatorTrait ;
1010use Aternos \Taskmaster \Communication \Socket \SocketInterface ;
11+ use Aternos \Taskmaster \Communication \StdStreams ;
1112use Aternos \Taskmaster \Exception \PhpError ;
1213use Aternos \Taskmaster \Exception \PhpFatalErrorException ;
1314use Aternos \Taskmaster \Taskmaster ;
@@ -102,7 +103,7 @@ protected function handleFail(null|string|Exception $reason = null): static
102103 if ($ reason instanceof Exception) {
103104 $ reason = $ reason ->getMessage ();
104105 }
105- fwrite (STDERR , "Runtime failed: " . $ reason . PHP_EOL );
106+ fwrite (StdStreams:: getInstance ()-> getStderr () , "Runtime failed: " . $ reason . PHP_EOL );
106107 exit (1 );
107108 }
108- }
109+ }
Original file line number Diff line number Diff line change 66use Aternos \Taskmaster \Communication \Promise \TaskPromise ;
77use Aternos \Taskmaster \Communication \Request \ExecuteFunctionRequest ;
88use Aternos \Taskmaster \Communication \ResponseInterface ;
9+ use Aternos \Taskmaster \Communication \StdStreams ;
910use Aternos \Taskmaster \Exception \PhpError ;
1011use Aternos \Taskmaster \Runtime \RuntimeInterface ;
1112use Closure ;
@@ -175,7 +176,7 @@ public function handleResult(mixed $result): void
175176 public function handleError (Exception $ error ): void
176177 {
177178 $ this ->error = $ error ;
178- fwrite (STDERR , $ error ->getMessage () . PHP_EOL );
179+ fwrite (StdStreams:: getInstance ()-> getStderr () , $ error ->getMessage () . PHP_EOL );
179180 }
180181
181182 /**
@@ -287,4 +288,4 @@ protected function isSync(): bool
287288 {
288289 return $ this ->sync ;
289290 }
290- }
291+ }
You can’t perform that action at this time.
0 commit comments