Function in io compiler

drive

fn drive() -> int
Import
use io::{drive};
Source: compiler/src/builtin_docs/io.hy

Deprecated: polls the registered IO waiters once and returns how many became ready.

Calling it gives warning E0129. Run concurrent IO as tasks instead (task::scope with spawn and join): an IO wait inside a task suspends only that task.

Returns#

int

Examples#

use io::{drive};
let ready = drive(); // warning E0129: `drive` is deprecated

See also#

  • task::scope
  • stdin: Returns a new stream on the process’s standard input.
  • stdout: Returns a new stream on the process’s standard output.
  • stderr: Returns a new stream on the process’s standard error.
  • capture_begin: Starts keeping this thread’s stdout and stderr writes in memory instead of writing them, until the matching capture_end().
  • capture_end: Ends the innermost capture_begin() and returns what it kept, as (stdout, stderr).
  • open: Opens the file at path with mode and returns a stream on it.
  • close: Closes s.
↑ ↓ navigate ↵ open