FswatchDriver
class FswatchDriver extends AbstractDriver
Properties
| protected Channel|null | $stopSignal | from AbstractDriver | |
| protected bool | $stopping | from AbstractDriver | |
| protected mixed | $process | ||
| protected array<int, resource> | $pipes |
Methods
Stop the fswatch process.
Run a polling scan until the driver is stopped.
Resolve configured watch paths to absolute targets.
Execute a shell command using Swoole's coroutine-aware exec.
Escape a list of arguments for interpolation into a shell command.
Process complete newline-delimited paths while retaining a partial tail.
Open the fswatch subprocess and retain its pipes.
Build the fswatch command arguments.
Details
at line 20
__construct(Option $option)
No description
in
AbstractDriver at line 26
bool
isDarwin()
Determine if the current OS is macOS.
at line 123
void
stop()
Stop the fswatch process.
in
AbstractDriver at line 47
protected void
watchAtInterval(float $seconds, callable $scan)
Run a polling scan until the driver is stopped.
in
AbstractDriver at line 80
protected array
resolveTargets(array $watchPaths)
Resolve configured watch paths to absolute targets.
in
AbstractDriver at line 100
protected array
existingTargets(array $targets)
Filter targets that currently exist.
in
AbstractDriver at line 112
protected array
exec(string $command)
Execute a shell command using Swoole's coroutine-aware exec.
Every interpolated argument must be escaped before it reaches this boundary.
in
AbstractDriver at line 128
protected string
shellArguments(array $arguments)
Escape a list of arguments for interpolation into a shell command.
at line 32
void
watch(Channel $channel)
Watch for file changes using fswatch.
at line 88
protected void
processOutput(string $buffer, string $chunk, Channel $channel, string $basePath, array $watchPaths, bool $final = false)
Process complete newline-delimited paths while retaining a partial tail.
at line 150
protected void
openProcess()
Open the fswatch subprocess and retain its pipes.
at line 169
protected bool
shouldStopWatching(Channel $channel)
Determine whether the active watch loop should stop.
The state may change while hooked I/O yields to another coroutine.
at line 179
protected array
getCommand()
Build the fswatch command arguments.