--- a/util/pubsub.lua Sun Dec 05 02:46:08 2010 +0100 +++ b/util/pubsub.lua Sun Dec 05 04:19:23 2010 +0100 @@ -54,6 +54,18 @@ return true; end +function service:retract(node, actor, id, retract) + local node_obj = self.nodes[node]; + if (not node_obj) or (not node_obj.data[id]) then + return false, "item-not-found"; + end + node_obj.data[id] = nil; + if retract then + self.cb.broadcaster(node, node_obj.subscribers, retract); + end + return true +end + function service:get(node, actor, id) local node_obj = self.nodes[node]; if node_obj then