Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd93c515

Browse files
committed
minor#10492 Add some lines of doc for waitUntil() (Process) (Nek-)
This PR was merged into the master branch.Discussion----------Add some lines of doc for waitUntil() (Process)This adds some documentation forsymfony/symfony#27742Commits-------2814fea Add some lines of doc for waitUntil() (Process)
2 parentse56793b +2814fea commitd93c515

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎components/process.rst‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,21 @@ in the output and its type::
233233
}
234234
});
235235

236+
You may want to wait for a specific output of the process you started
237+
asynchronously, for this use case you may use the method
238+
:method:`Symfony\\Component\\Process\\Process::waitUntil`:
239+
240+
$process = new Process(array('/usr/bin/php', 'slow-starting-server.php'));
241+
$process->start();
242+
243+
// ... do other things
244+
245+
$process->waitUntil(function ($type, $output) {
246+
return $output === 'Ready. Waiting for commands...';
247+
});
248+
249+
// ... do things after the process is ready
250+
236251
Streaming to the Standard Input of a Process
237252
--------------------------------------------
238253

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp