aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-05-31 17:04:17 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-05-31 17:04:17 +0200
commitf7a38b5681ebf7429828fca9a9f7c109df853d54 (patch)
tree9c4e702071a6915719ca639790936b35ed1ed828 /docs
parent95e5bf6461be6e227466911d5e3a683d149df725 (diff)
downloadlanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.tar.gz
lanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.tar.bz2
lanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.zip
Some API changes
* lanes.timers() can return nil, cancel_error if interrupted * linda:receive() always return a k,v, where k is nil when v is "timeout" or cancel_error * lanes.sleep returns nil, "timeout" during normal operations
Diffstat (limited to 'docs')
-rw-r--r--docs/index.html18
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/index.html b/docs/index.html
index 0d97c29..98c2abb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1198,9 +1198,9 @@
1198 1198
1199 [true|lanes.cancel_error] = h:send([timeout_secs,] key, ...) 1199 [true|lanes.cancel_error] = h:send([timeout_secs,] key, ...)
1200 1200
1201 [key, val]|[lanes.cancel_error] = h:receive([timeout_secs,] key [, ...]) 1201 key, val = h:receive([timeout_secs,] key [, key...])
1202 1202
1203 [key, val [, ...]]|[lanes.cancel_error] = h:receive(timeout, h.batched, key, n_uint_min[, n_uint_max]) 1203 key, val [, val...] = h:receive(timeout, h.batched, key, n_uint_min[, n_uint_max])
1204 1204
1205 [true|lanes.cancel_error] = h:limit(key, n_uint) 1205 [true|lanes.cancel_error] = h:limit(key, n_uint)
1206</pre></td></tr></table> 1206</pre></td></tr></table>
@@ -1235,9 +1235,9 @@
1235</p> 1235</p>
1236 1236
1237<p> 1237<p>
1238 Equally, <tt>receive()</tt> returns a key and the value extracted from it, or nothing for timeout. Note that <tt>nil</tt>s can be sent and received; the <tt>key</tt> value will tell it apart from a timeout. 1238 Equally, <tt>receive()</tt> returns a key and the value extracted from it. Note that <tt>nil</tt>s can be sent and received; the <tt>key</tt> value will tell it apart from a timeout.<br/>
1239 <br/> 1239 <tt>receive()</tt> returns <tt>nil, lanes.cancel_error</tt> if interrupted by a hard cancel request.<br/>
1240 <tt>receive()</tt> returns <tt>lanes.cancel_error</tt> if interrupted by a soft cancel request. 1240 <tt>receive()</tt> returns <tt>nil, "timeout"</tt> if nothing was available.
1241</p> 1241</p>
1242 1242
1243<p> 1243<p>
@@ -1439,16 +1439,18 @@ On the other side, you need to use a common Linda for waiting for multiple keys.
1439</pre></td></tr></table> 1439</pre></td></tr></table>
1440 1440
1441<p> 1441<p>
1442 The full list of active timers can be obtained. Obviously, this is a snapshot, and non-repeating timers might no longer exist by the time the results are inspected. 1442 The full list of active timers can be obtained. Obviously, this is a snapshot, and non-repeating timers might no longer exist by the time the results are inspected.<br />
1443 Can return <tt>nil, "timeout"</tt> or <tt>nil, lanes.cancel_error</tt> in case of interruption.
1443</p> 1444</p>
1444 1445
1445<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> 1446<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre>
1446 void = lanes.sleep(['indefinitely'|seconds|nil]) 1447 nil, "timeout" = lanes.sleep(['indefinitely'|seconds|nil])
1447</pre></td></tr></table> 1448</pre></td></tr></table>
1448 1449
1449<p> 1450<p>
1450 A very simple way of sleeping when nothing else is available. Is implemented by attempting to read some data in an unused channel of the internal linda used for timers (this linda exists even when timers aren't enabled). 1451 A very simple way of sleeping when nothing else is available. Is implemented by attempting to read some data in an unused channel of the internal linda used for timers (this linda exists even when timers aren't enabled).
1451 Default duration is 0, which should only cause a thread context switch. 1452 Default duration is 0, which should only cause a thread context switch.<br />
1453 Return values should always be <tt>nil, "timeout"</tt> (or <tt>nil, lanes.cancel_error</tt> in case of interruption).
1452</p> 1454</p>
1453 1455
1454<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> 1456<table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre>