If read/accept/write are blocking FFI, do this:
var {*} = import("slug.channel")
fn readWithTimeout(conn, n, ms) {
var t = spawn { read(conn, n) }
await(t, ms)
}
This is the simplest portable approach.
If read/accept/write are blocking FFI, do this:
var {*} = import("slug.channel")
fn readWithTimeout(conn, n, ms) {
var t = spawn { read(conn, n) }
await(t, ms)
}
This is the simplest portable approach.