Skip to content

stdlib/asyncView source ↗

async

12 items · generated by scribe fromstdlib/async.fd· synced 2026-11-15

stdlib/async12 items

Contents

async_executor

Create a task executor.

pub fn async_executor() -> i64 {

Returns: i64

Defined at line 25


async_spawn

Spawn a named function with nargs i64 args (max 8). Returns a future handle.

pub fn async_spawn(exec: i64, fname: str, nargs: i64, a1: i64) -> i64 {

Parameters:

  • exec: i64
  • fname: str
  • nargs: i64
  • a1: i64

Returns: i64

Defined at line 31


async_poll

Poll a task: returns its value if ready, or PENDING.

pub fn async_poll(exec: i64, fut: i64) -> i64 {

Parameters:

  • exec: i64
  • fut: i64

Returns: i64

Defined at line 36


async_ready

True when the task has finished.

pub fn async_ready(fut: i64) -> bool {

Parameters:

  • fut: i64

Returns: bool

Defined at line 41


async_await

Block until the task completes; returns its value.

pub fn async_await(exec: i64, fut: i64) -> i64 {

Parameters:

  • exec: i64
  • fut: i64

Returns: i64

Defined at line 46


async_run_all

Run all spawned tasks to completion.

pub fn async_run_all(exec: i64) -> void {

Parameters:

  • exec: i64

Returns: void

Defined at line 51


io_nonblock

Put a socket fd into nonblocking mode (1) or back to blocking (0).

pub fn io_nonblock(fd: i64, on: i64) -> i64 {

Parameters:

  • fd: i64
  • on: i64

Returns: i64

Defined at line 58


io_wait_readable

Wait until fd is readable (or timeout_ms elapses). Returns 1 if ready, 0 on timeout, <0 on error. timeout_ms < 0 waits forever.

pub fn io_wait_readable(fd: i64, timeout_ms: i64) -> i64 {

Parameters:

  • fd: i64
  • timeout_ms: i64

Returns: i64

Defined at line 65


io_wait_writable

Wait until fd is writable (or timeout_ms elapses).

pub fn io_wait_writable(fd: i64, timeout_ms: i64) -> i64 {

Parameters:

  • fd: i64
  • timeout_ms: i64

Returns: i64

Defined at line 70


io_wait

Wait for either readable or writable; returns bitmask (1=readable, 2=writable, 0=timeout). Polls twice — cheap approximation since select() checks both sets in one call anyway.

pub fn io_wait(fd: i64, timeout_ms: i64) -> i64 {

Parameters:

  • fd: i64
  • timeout_ms: i64

Returns: i64

Defined at line 77


PollFd

A registered fd in the poll set.

pub struct PollFd {

Fields:

NameType
fdi64
eventsi64

Defined at line 91


io_poll

Poll a set of fds; returns index of the first ready fd, or -1 on timeout/error. Round-robins p_socket_poll per fd — adequate for small server fanouts (select per fd).

pub fn io_poll(fds: Vec<PollFd>, timeout_ms: i64) -> i64 {

Parameters:

  • fds: Vec<PollFd>
  • timeout_ms: i64

Returns: i64

Defined at line 99


Generated by scribe, the Fides documentation generator