NAME

Linux::Event::Fork::Child - Child handle returned by Linux::Event::Fork

SYNOPSIS

my $child = $loop->fork(
  tag => "job:42",
  cmd => [ "sleep", "10" ],
  timeout => 2,
  on_timeout => sub ($child) {
    warn "timeout: " . ($child->tag // $child->pid);
  },
  on_exit => sub ($child, $exit) {
    $loop->stop;
  },
);

$child->stdin_write($bytes);
$child->close_stdin;

$child->cancel; # idempotent teardown

DESCRIPTION

Child handles are returned by Linux::Event::Fork and represent exactly one spawned child plus any internal watchers/subscriptions created for it.

METHODS

pid

Returns the child PID.

tag

Returns the optional label from spawn time.

data

Returns the opaque user data from spawn time.

kill

$child->kill('TERM');

Sends a signal to the child.

stdin_write

Queues bytes to be written to the child's stdin. Writes are non-blocking and backpressure-aware. SIGPIPE is ignored during writes; EPIPE is treated as a normal close.

close_stdin

Requests stdin closure after queued bytes are drained.

cancel

Idempotently cancels watchers/subscriptions and closes owned filehandles.

SEE ALSO

Linux::Event::Fork, Linux::Event::Fork::Exit

AUTHOR

Joshua S. Day (HAX)

LICENSE

Same terms as Perl itself.