Sha256: d881d7ae2b0007a507a1e20f4564addaaef80c818e313f1075468beb079a24b0

Contents?: true

Size: 807 Bytes

Versions: 5

Compression:

Stored size: 807 Bytes

Contents

---
layout: page
title: Gyro::Child
parent: API Reference
permalink: /api-reference/gyro-child/
---
# Gyro::Child

`Gyro::Child` encapsulates a libev [child
watcher](http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_child_code_watch_out_for_pro),
used for waiting for a child process to terminate. A `Gyro::Child` watcher
instance can be used for low-level control of child processes, instead of using
more high-level APIs such `Process.wait` etc.

## Instance methods

### #await → [pid, exitcode]

Blocks the current thread until the watcher is signalled. The return value is an
array containing the child's pid and the exit code.

```ruby
pid = Polyphony.fork { sleep 1 }
Gyro::Child.new(pid).await #=> [pid, 0]
```

### #initialize(pid)

Initializes the watcher instance with the given pid

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polyphony-0.41 docs/api-reference/gyro-child.md
polyphony-0.40 docs/api-reference/gyro-child.md
polyphony-0.39 docs/api-reference/gyro-child.md
polyphony-0.38 docs/api-reference/gyro-child.md
polyphony-0.36 docs/api-reference/gyro-child.md