diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.html | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/index.html b/docs/index.html index e884145..06ce610 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -1209,13 +1209,14 @@ | |||
1209 | </p> | 1209 | </p> |
1210 | 1210 | ||
1211 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1211 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |
1212 | true|(nil,[lanes.cancel_error|"timeout"]) = h:limit(key, n_uint) | 1212 | bool|(nil,[lanes.cancel_error|"timeout"]) = h:limit(key, n_uint) |
1213 | </pre></td></tr></table> | 1213 | </pre></td></tr></table> |
1214 | 1214 | ||
1215 | <p> | 1215 | <p> |
1216 | 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 /> | 1216 | 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 /> |
1217 | A limit of 0 is allowed to block everything.<br /> | 1217 | A limit of 0 is allowed to block everything.<br /> |
1218 | 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.<br /> | 1218 | 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 /> |
1219 | Or <tt>nil, lanes.cancel_error</tt> in case of cancellation, of course. | ||
1219 | </p> | 1220 | </p> |
1220 | 1221 | ||
1221 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1222 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |
@@ -1276,15 +1277,19 @@ | |||
1276 | </p> | 1277 | </p> |
1277 | 1278 | ||
1278 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1279 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |
1279 | true|lanes.cancel_error = linda_h:set(key [, val [, ...]]) | 1280 | true|nil,lanes.cancel_error = linda_h:set(key [, val [, ...]]) |
1280 | 1281 | ||
1281 | [[val [, ...]]|lanes.cancel_error] = linda_h:get(key [, count = 1]) | 1282 | [number,[val [, ...]]|nil,lanes.cancel_error] = linda_h:get(key [, count = 1]) |
1282 | </pre></td></tr></table> | 1283 | </pre></td></tr></table> |
1283 | 1284 | ||
1284 | <p> | 1285 | <p> |
1285 | The table access methods are for accessing a slot without queuing or consuming. They can be used for making shared tables of storage among the lanes.<br /> | 1286 | The table access methods are for accessing a slot without queuing or consuming. They can be used for making shared tables of storage among the lanes.<br /> |
1286 | Writing to a slot never blocks because it ignores the limit. It overwrites existing value and clears any possible queued entries.<br /> | 1287 | Writing to a slot never blocks because it ignores the limit. It overwrites existing value and clears any possible queued entries.<br /> |
1287 | Reading doesn't block either because <tt>get()</tt> returns whatever is available (which can be nothing), up to the specified count.<br /> | 1288 | Reading doesn't block either because <tt>get()</tt> returns: |
1289 | <ul> | ||
1290 | <li><tt>nil, lanes.cancel_error</tt> in case of cancellation.</li> | ||
1291 | <li><tt>number, val...</tt> where number is the actual count of items obtained from the linda (can be 0).</li> | ||
1292 | </ul> | ||
1288 | Table access and <tt>send()</tt>/<tt>receive()</tt> can be used together; reading a slot essentially peeks the next outcoming value of a queue. | 1293 | Table access and <tt>send()</tt>/<tt>receive()</tt> can be used together; reading a slot essentially peeks the next outcoming value of a queue. |
1289 | </p> | 1294 | </p> |
1290 | 1295 | ||