openresty / openresty/lua-nginx-module
Should ngx.shared.DICT.get be able to return a list initialized with ngx.shared.DICT.rpush/lpush?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.8k
- Forks
- 2.1k
- Avg merge
- 6h 1m
- Merged PRs (30d)
- 6
Description
OpenResty version: edge
The documentation for ngx.shared.DICT.get does not state that get is unable to retrieve lists built using ngx.shared.DICT.rpush and lpush. However, any attempt to do this fails with an error. This is the relevant section of implementation code:
I would like to ask: Do the developers of OpenResty consider it undesirable to allow get to retrieve a list from a shared dict? Or did you simply not have time to implement it yet?
If it is a matter of not yet having time to implement this feature, I would be happy to send a PR. (The code would copy the contents of the list into a new Lua table, and return that.)
On the other hand, if the project maintainers do not want this feature, it would be better to update the documentation to be more clear. (I would also be happy to send a PR for that.)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/ngx_http_lua_shdict.c at lines 1672-1677 and compare the documented behavior of ngx.shared.DICT.get, rpush, and lpush. Determine whether list retrieval is intended; completion would require either a scoped implementation with coverage for list values or documentation that explicitly explains the limitation, depending on maintainer direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua, nginx
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100