# std.Io: proof-of-concept "operations" API · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d63172a35da5d493aef72aa074afa90ac5bb619a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d63172a35da5d493aef72aa074afa90ac5bb619a

Requested commit: d63172a35da5d493aef72aa074afa90ac5bb619a

Commit: d63172a35da5d493aef72aa074afa90ac5bb619a

Tree: 8b7254d33b34e466eaf59cdbd5f83491d401250a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.Io: proof-of-concept "operations" API

This commit shows a proof-of-concept direction for std.Io.VTable to go,
which is to have general support for batching, timeouts, and
non-blocking.

I'm not sure if this is a good idea or not so I'm putting it up for
scrutiny.

This commit introduces `std.Io.operate`, `std.Io.Operation`, and
implements it experimentally for `FileReadStreaming`.

In `std.Io.Threaded`, the implementation is based on poll().

This commit shows how it can be used in `std.process.run` to collect
both stdout and stderr in a single-threaded program using
`std.Threaded.Io`.

It also demonstrates how to upgrade code that was previously using
`std.Io.poll` (*not* integrated with the interface!) using concurrency.
This may not be ideal since it makes the build runner no longer support
single-threaded mode. There is still a needed abstraction for
conveniently reading multiple File streams concurrently without
io.concurrent, but this commit demonstrates that such an API can be
built on top of the new `std.Io.operate` functionality.

```

## Parents

- [31fadc0eee2dc25983f493eca7e843629b917b2b](https://git.cafe/gitcafe/zig/commit/31fadc0eee2dc25983f493eca7e843629b917b2b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d63172a35da5d493aef72aa074afa90ac5bb619a?format=markdown)
