You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature: added new shdict methods: lpush, lpop, rpush, rpop, llen for manipulating list-typed values.
These methods can be used in the same way as the redis commands of the
same names. Essentially we now have shared memory based queues now. Each
queue is indexed by a key.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
Retrieving the value in the dictionary [ngx.shared.DICT](#ngxshareddict) for the key `key`. If the key does not exist or has been expired, then `nil` will be returned.
6106
+
Retrieving the value in the dictionary [ngx.shared.DICT](#ngxshareddict) for the key `key`. If the key does not exist or has expired, then `nil` will be returned.
6097
6107
6098
6108
In case of errors, `nil` and a string describing the error will be returned.
6099
6109
@@ -6298,6 +6308,86 @@ See also [ngx.shared.DICT](#ngxshareddict).
Inserts the specified (numerical or string) `value` at the head of the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict). Returns the number of elements in the list after the push operation.
6318
+
6319
+
If `key` does not exist, it is created as an empty list before performing the push operations. When the `key` already takes a value that is not a list, it will return `nil` and `"value not a list"`.
6320
+
6321
+
It never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return `nil` and the string "no memory".
6322
+
6323
+
This feature was first introduced in the `v0.10.6` release.
Returns the number of elements in the list named `key` in the shm-based dictionary [ngx.shared.DICT](#ngxshareddict).
6382
+
6383
+
If key does not exist, it is interpreted as an empty list and 0 is returned. When the `key` already takes a value that is not a list, it will return `nil` and `"value not a list"`.
6384
+
6385
+
This feature was first introduced in the `v0.10.6` release.
Retrieving the value in the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] for the key <code>key</code>. If the key does not exist or has been expired, then <code>nil</code> will be returned.
5114
+
Retrieving the value in the dictionary [[#ngx.shared.DICT|ngx.shared.DICT]] for the key <code>key</code>. If the key does not exist or has expired, then <code>nil</code> will be returned.
5110
5115
5111
5116
In case of errors, <code>nil</code> and a string describing the error will be returned.
5112
5117
@@ -5281,6 +5286,71 @@ The optional `init` parameter was first added in the <code>v0.10.6</code> releas
Inserts the specified (numerical or string) <code>value</code> at the head of the list named <code>key</code> in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]]. Returns the number of elements in the list after the push operation.
5295
+
5296
+
If <code>key</code> does not exist, it is created as an empty list before performing the push operations. When the <code>key</code> already takes a value that is not a list, it will return <code>nil</code> and <code>"value not a list"</code>.
5297
+
5298
+
It never overrides the (least recently used) unexpired items in the store when running out of storage in the shared memory zone. In this case, it will immediately return <code>nil</code> and the string "no memory".
5299
+
5300
+
This feature was first introduced in the <code>v0.10.6</code> release.
Similar to the [[#ngx.shared.DICT.lpush|lpush]] method, but inserts the specified (numerical or string) <code>value</code> at the tail of the list named <code>key</code>.
5310
+
5311
+
This feature was first introduced in the <code>v0.10.6</code> release.
Removes and returns the first element of the list named <code>key</code> in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]].
5321
+
5322
+
If <code>key</code> does not exist, it will return <code>nil</code>. When the <code>key</code> already takes a value that is not a list, it will return <code>nil</code> and <code>"value not a list"</code>.
5323
+
5324
+
This feature was first introduced in the <code>v0.10.6</code> release.
Removes and returns the last element of the list named <code>key</code> in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]].
5334
+
5335
+
If <code>key</code> does not exist, it will return <code>nil</code>. When the <code>key</code> already takes a value that is not a list, it will return <code>nil</code> and <code>"value not a list"</code>.
5336
+
5337
+
This feature was first introduced in the <code>v0.10.6</code> release.
Returns the number of elements in the list named <code>key</code> in the shm-based dictionary [[#ngx.shared.DICT|ngx.shared.DICT]].
5347
+
5348
+
If key does not exist, it is interpreted as an empty list and 0 is returned. When the <code>key</code> already takes a value that is not a list, it will return <code>nil</code> and <code>"value not a list"</code>.
5349
+
5350
+
This feature was first introduced in the <code>v0.10.6</code> release.
0 commit comments