class ServerRestartStrategy implements RestartStrategy

Properties

protected int|null $processId
protected bool $lifecycleRunning
protected bool $restartRequested
protected bool $stopping
protected string $bin
protected non-empty-list<non-empty-string> $command

Methods

__construct(Container $container, OutputInterface $output)

No description

void
start()

Perform the initial start of the server process.

void
restart()

Restart the server process (stop current instance, start new).

void
stop()

Stop the currently running server process.

int|null
currentProcessId()

Return the currently published server process ID.

void
terminateServer()

Terminate the currently published server process.

void
reportStopFailure()

Report a failed server termination.

void
launchServer()

Launch the server lifecycle in its owner coroutine.

void
runServer()

Run one watched server process to completion.

array
serverCommand()

Build the server command arguments without a shell intermediary.

mixed
openProcess(array $descriptorSpec, array $pipes)

Open the watched server process.

int
closeProcess(mixed $process)

Close the watched server process.

array
processStatus(mixed $process)

Read the watched server process status.

bool
signalProcess(int $pid, int $signal)

Send a signal to a server process.

void
reloadEnvironment()

Reload the application environment before spawning a server.

Details

at line 32
__construct(Container $container, OutputInterface $output)

No description

Parameters

Container $container
OutputInterface $output

at line 64
void start()

Perform the initial start of the server process.

Return Value

void

at line 78
void restart()

Restart the server process (stop current instance, start new).

Return Value

void

at line 97
void stop()

Stop the currently running server process.

Return Value

void

at line 111
protected int|null currentProcessId()

Return the currently published server process ID.

The value may change while hooked output yields to another coroutine.

Return Value

int|null

at line 119
protected void terminateServer()

Terminate the currently published server process.

Return Value

void

at line 150
protected void reportStopFailure()

Report a failed server termination.

Return Value

void

at line 161
protected void launchServer()

Launch the server lifecycle in its owner coroutine.

Return Value

void

at line 193
protected void runServer()

Run one watched server process to completion.

Return Value

void

at line 256
protected array serverCommand()

Build the server command arguments without a shell intermediary.

Return Value

array

at line 271
protected mixed openProcess(array $descriptorSpec, array $pipes)

Open the watched server process.

Parameters

array $descriptorSpec
array $pipes

Return Value

mixed

at line 285
protected int closeProcess(mixed $process)

Close the watched server process.

Parameters

mixed $process

Return Value

int

at line 296
protected array processStatus(mixed $process)

Read the watched server process status.

Parameters

mixed $process

Return Value

array

at line 304
protected bool signalProcess(int $pid, int $signal)

Send a signal to a server process.

Parameters

int $pid
int $signal

Return Value

bool

at line 312
protected void reloadEnvironment()

Reload the application environment before spawning a server.

Return Value

void