Io module

scheduler_local

procedureextensionexperimentalSource

The value a library stored for key on the running scheduler, or null. Keys are addresses of something the library owns (a global works). This is the per-thread variable the language does not have: the Http client keeps its connection pool here.

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


Io.io_run(() {
    counter: int;
    Io.set_scheduler_local(*counter, *counter, null);
    assert(Io.scheduler_local(*counter) == *counter);
});
scheduler_local :: (key: *void) -> *void

The value a library stored for key on the running scheduler, or null. Keys are addresses of something the library owns (a global works). This is the per-thread variable the language does not have: the Http client keeps its connection pool here.

Parameters

key: *void

Returns

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

Io.io_run(() {
    counter: int;
    Io.set_scheduler_local(*counter, *counter, null);
    assert(Io.scheduler_local(*counter) == *counter);
});

See also