diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-26 17:45:16 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-26 17:45:16 +0200 |
commit | 62a7eab66f8f6af66c94390138815c3171b62810 (patch) | |
tree | 0b93a11f97e186d82a931b40ae092f7438ca3f31 /docs | |
parent | e715be93bf00a452a6c2f1cd86a60b4ef5f30b07 (diff) | |
download | lanes-62a7eab66f8f6af66c94390138815c3171b62810.tar.gz lanes-62a7eab66f8f6af66c94390138815c3171b62810.tar.bz2 lanes-62a7eab66f8f6af66c94390138815c3171b62810.zip |
Change linda:limit()
* read the current limit of a key if no limit is provided
* "unlimited" is to be used to clear the limit
* fix linda:set() not ignoring the limit
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/index.html b/docs/index.html index c6cf474..8e84fcb 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -1222,14 +1222,16 @@ | |||
1222 | </p> | 1222 | </p> |
1223 | 1223 | ||
1224 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1224 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |
1225 | bool|(nil,[lanes.cancel_error|"timeout"]) = h:limit(key, n_uint) | 1225 | bool|(nil,[lanes.cancel_error|"timeout"]) = h:limit(key, <limit>) |
1226 | >limit< = h:limit(key) | ||
1226 | </pre></td></tr></table> | 1227 | </pre></td></tr></table> |
1227 | 1228 | ||
1228 | <p> | 1229 | <p> |
1229 | By default, queue sizes are unlimited but limits can be enforced using the <tt>limit()</tt> method. This can be useful to balance execution speeds in a producer/consumer scenario. <tt>nil</tt> removes the limit.<br /> | 1230 | By default, queue sizes are unlimited but limits can be enforced using the <tt>limit()</tt> method. This can be useful to balance execution speeds in a producer/consumer scenario.<br /> |
1230 | A limit of 0 is allowed to block everything.<br /> | 1231 | A limit of 0 is allowed to block everything. <tt>"unlimited"</tt> removes the limit.<br /> |
1231 | If the key was full but the limit change added some room, <tt>limit()</tt> returns <tt>true</tt> and the Linda is signalled so that <tt>send()</tt>-blocked threads are awakened, else the return value is <tt>false</tt>.<br /> | 1232 | If the key was full but the limit change added some room, <tt>limit()</tt> returns <tt>true</tt> and the Linda is signalled so that <tt>send()</tt>-blocked threads are awakened, else the return value is <tt>false</tt>. |
1232 | Or <tt>nil, lanes.cancel_error</tt> in case of cancellation, of course. | 1233 | If no limit is provided, <tt>limit()</tt> returns a single value, the current limit for the specified key.<br /> |
1234 | Whether reading or writing, if the Linda is cancelled, <tt>limit()</tt> returns <tt>nil, lanes.cancel_error</tt>. | ||
1233 | </p> | 1235 | </p> |
1234 | 1236 | ||
1235 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1237 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |