Software /
code /
prosody
Diff
plugins/mod_pubsub/mod_pubsub.lua @ 9108:86f31a2174b3
mod_pubsub: Add comment to document nodestore/itemstore methods
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Aug 2018 21:33:17 +0100 |
parent | 9101:1ff694534e98 |
child | 9118:70f34c663fb3 |
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua Sat Aug 04 21:32:24 2018 +0100 +++ b/plugins/mod_pubsub/mod_pubsub.lua Sat Aug 04 21:33:17 2018 +0100 @@ -25,6 +25,20 @@ return lib_pubsub.handle_pubsub_iq(event, service); end +-- An itemstore supports the following methods: +-- items(): iterator over (id, item) +-- get(id): return item with id +-- set(id, item): set id to item +-- clear(): clear all items +-- resize(n): set new limit and trim oldest items +-- tail(): return the latest item + +-- A nodestore supports the following methods: +-- set(node_name, node_data) +-- get(node_name) +-- users(): iterator over (node_name) + + local node_store = module:open_store(module.name.."_nodes"); local function create_simple_itemstore(node_config, node_name)