From 2814fea88a40362da3406c6c075f6de03b4709ac Mon Sep 17 00:00:00 2001 From: Maxime Veber Date: Mon, 15 Oct 2018 16:37:51 +0200 Subject: [PATCH] Add some lines of doc for waitUntil() (Process) --- components/process.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/process.rst b/components/process.rst index 9d07ff264f4..0f383de9881 100644 --- a/components/process.rst +++ b/components/process.rst @@ -233,6 +233,21 @@ in the output and its type:: } }); +You may want to wait for a specific output of the process you started +asynchronously, for this use case you may use the method +:method:`Symfony\\Component\\Process\\Process::waitUntil`: + + $process = new Process(array('/usr/bin/php', 'slow-starting-server.php')); + $process->start(); + + // ... do other things + + $process->waitUntil(function ($type, $output) { + return $output === 'Ready. Waiting for commands...'; + }); + + // ... do things after the process is ready + Streaming to the Standard Input of a Process -------------------------------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy