Io module

send

procedureextensionexperimentalSource

Puts value into the channel, blocking while it is full. .CLOSED if the channel is (or becomes) closed, .CANCELED if the fiber is canceled while it waits.

Example↗
Io :: #import "Extensions/Io";

Io.io_run(() {
    channel := Io.make_channel(string, 1);
    defer Io.free_channel(channel);

    assert(Io.send(channel, "first") == .NONE);

    Io.close(channel);
    assert(Io.send(channel, "second") == .CLOSED);
});
send :: (channel: *Channel($T), value: T) -> Io_Error

Parameters

channel: *Channel($T)
value: T

Returns

See also