groupmq-plus 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,6 +145,14 @@ elseif status == "failed" then
145
145
  end
146
146
  end
147
147
 
148
+ -- Publish completion/failure event for waiters
149
+ local eventPayload = cjson.encode({
150
+ id = completedJobId,
151
+ status = status,
152
+ result = resultOrError
153
+ })
154
+ redis.call("PUBLISH", ns .. ":events", eventPayload)
155
+
148
156
  -- Part 3: Handle group active list and get next job (BullMQ-style)
149
157
  local groupActiveKey = ns .. ":g:" .. gid .. ":active"
150
158
  local activeJobId = redis.call("LINDEX", groupActiveKey, 0)
@@ -186,5 +186,13 @@ elseif status == "failed" then
186
186
  end
187
187
  end
188
188
 
189
+ -- Publish completion/failure event for waiters
190
+ local eventPayload = cjson.encode({
191
+ id = jobId,
192
+ status = status,
193
+ result = resultOrError
194
+ })
195
+ redis.call("PUBLISH", ns .. ":events", eventPayload)
196
+
189
197
  return 1
190
198
 
@@ -139,5 +139,15 @@ elseif status == "failed" then
139
139
  end
140
140
  end
141
141
 
142
+ -- Publish completion/failure event for waiters
143
+ if status == "completed" or status == "failed" then
144
+ local eventPayload = cjson.encode({
145
+ id = jobId,
146
+ status = status,
147
+ result = resultOrError
148
+ })
149
+ redis.call("PUBLISH", ns .. ":events", eventPayload)
150
+ end
151
+
142
152
  return 1
143
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groupmq-plus",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Per-group FIFO queue on Redis with visibility timeouts and retries.",
5
5
  "license": "MIT",
6
6
  "private": false,