Sha256: c39d8a99a6bdcb47a0c7ffcfa5b74c13a64ca265c0b2a39a615ce823c1029d18

Contents?: true

Size: 935 Bytes

Versions: 93

Compression:

Stored size: 935 Bytes

Contents

---
layout: page
title: ::IO
parent: API Reference
permalink: /api-reference/io/
---
# ::IO

[Ruby core IO documentation](https://ruby-doc.org/core-2.7.0/IO.html)

Polyphony reimplements a significant number of IO class and instance methods to
be fiber-aware. Polyphony also adds methods for accessing the associated event
watchers.

## Class Methods

## Instance methods

### #read_watcher → io_watcher

Returns the read watcher associated with the IO. The watcher is automatically
created and cached. The watcher is an instance of `Gyro::IO`. Normally this
method is not called directly from application code.

```ruby
def read_ten_chars(io)
  io.read_watcher.await
  io.read(10)
end
```

### #write_watcher → io_watcher

Returns the write watcher associated with the IO. The watcher is automatically
created and cached. The watcher is an instance of `Gyro::IO`. Normally this
method is not called directly from application code.

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
polyphony-0.99 docs/api-reference/io.md
polyphony-0.98 docs/api-reference/io.md
polyphony-0.97 docs/api-reference/io.md
polyphony-0.96 docs/api-reference/io.md
polyphony-0.95 docs/api-reference/io.md
polyphony-0.94 docs/api-reference/io.md
polyphony-0.93 docs/api-reference/io.md
polyphony-0.92 docs/api-reference/io.md
polyphony-0.91 docs/api-reference/io.md
polyphony-0.90 docs/api-reference/io.md
polyphony-0.89 docs/api-reference/io.md
polyphony-0.87 docs/api-reference/io.md
polyphony-0.86 docs/api-reference/io.md
polyphony-0.85 docs/api-reference/io.md
polyphony-0.84.1 docs/api-reference/io.md
polyphony-0.84 docs/api-reference/io.md
polyphony-0.83 docs/api-reference/io.md
polyphony-0.82 docs/api-reference/io.md
polyphony-0.81.1 docs/api-reference/io.md
polyphony-0.81 docs/api-reference/io.md