1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-24 17:27:18 +00:00

Merge pull request #1124 from sogaiu/tweak-ev-select-docstring

Tweak ev/select docstring
This commit is contained in:
Calvin Rose 2023-05-08 04:17:25 -05:00 committed by GitHub
commit 2ac4988f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1012,11 +1012,16 @@ static void chan_unlock_args(const Janet *argv, int32_t n) {
JANET_CORE_FN(cfun_channel_choice, JANET_CORE_FN(cfun_channel_choice,
"(ev/select & clauses)", "(ev/select & clauses)",
"Block until the first of several channel operations occur. Returns a tuple of the form [:give chan], [:take chan x], or [:close chan], where " "Block until the first of several channel operations occur. Returns a "
"a :give tuple is the result of a write and :take tuple is the result of a read. Each clause must be either a channel (for " "tuple of the form [:give chan], [:take chan x], or [:close chan], "
"a channel take operation) or a tuple [channel x] for a channel give operation. Operations are tried in order, such that the first " "where a :give tuple is the result of a write and a :take tuple is the "
"clauses will take precedence over later clauses. Both and give and take operations can return a [:close chan] tuple, which indicates that " "result of a read. Each clause must be either a channel (for a channel "
"the specified channel was closed while waiting, or that the channel was already closed.") { "take operation) or a tuple [channel x] (for a channel give operation). "
"Operations are tried in order such that earlier clauses take "
"precedence over later clauses. Both give and take operations can "
"return a [:close chan] tuple, which indicates that the specified "
"channel was closed while waiting, or that the channel was already "
"closed.") {
janet_arity(argc, 1, -1); janet_arity(argc, 1, -1);
int32_t len; int32_t len;
const Janet *data; const Janet *data;