taskiq-redis 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

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.
@@ -260,11 +260,11 @@ class RedisStreamBroker(BaseRedisBroker):
260
260
  approximate=self.approximate,
261
261
  )
262
262
 
263
- def _ack_generator(self, id: str) -> Callable[[], Awaitable[None]]:
263
+ def _ack_generator(self, id: str, queue_name: str) -> Callable[[], Awaitable[None]]:
264
264
  async def _ack() -> None:
265
265
  async with Redis(connection_pool=self.connection_pool) as redis_conn:
266
266
  await redis_conn.xack(
267
- self.queue_name,
267
+ queue_name,
268
268
  self.consumer_group_name,
269
269
  id,
270
270
  )
@@ -287,12 +287,12 @@ class RedisStreamBroker(BaseRedisBroker):
287
287
  noack=False,
288
288
  count=self.count,
289
289
  )
290
- for _, msg_list in fetched:
290
+ for stream, msg_list in fetched:
291
291
  for msg_id, msg in msg_list:
292
292
  logger.debug("Received message: %s", msg)
293
293
  yield AckableMessage(
294
294
  data=msg[b"data"],
295
- ack=self._ack_generator(msg_id),
295
+ ack=self._ack_generator(id=msg_id, queue_name=stream),
296
296
  )
297
297
  logger.debug("Starting fetching unacknowledged messages")
298
298
  for stream in [self.queue_name, *self.additional_streams.keys()]:
@@ -318,5 +318,5 @@ class RedisStreamBroker(BaseRedisBroker):
318
318
  logger.debug("Received message: %s", msg)
319
319
  yield AckableMessage(
320
320
  data=msg[b"data"],
321
- ack=self._ack_generator(msg_id),
321
+ ack=self._ack_generator(id=msg_id, queue_name=stream),
322
322
  )
@@ -171,10 +171,10 @@ class RedisStreamClusterBroker(BaseRedisClusterBroker):
171
171
  approximate=self.approximate,
172
172
  )
173
173
 
174
- def _ack_generator(self, id: str) -> Callable[[], Awaitable[None]]:
174
+ def _ack_generator(self, id: str, queue_name: str) -> Callable[[], Awaitable[None]]:
175
175
  async def _ack() -> None:
176
176
  await self.redis.xack(
177
- self.queue_name,
177
+ queue_name,
178
178
  self.consumer_group_name,
179
179
  id,
180
180
  )
@@ -194,10 +194,10 @@ class RedisStreamClusterBroker(BaseRedisClusterBroker):
194
194
  block=self.block,
195
195
  noack=False,
196
196
  )
197
- for _, msg_list in fetched:
197
+ for stream, msg_list in fetched:
198
198
  for msg_id, msg in msg_list:
199
199
  logger.debug("Received message: %s", msg)
200
200
  yield AckableMessage(
201
201
  data=msg[b"data"],
202
- ack=self._ack_generator(msg_id),
202
+ ack=self._ack_generator(id=msg_id, queue_name=stream),
203
203
  )
@@ -239,11 +239,11 @@ class RedisStreamSentinelBroker(BaseSentinelBroker):
239
239
  approximate=self.approximate,
240
240
  )
241
241
 
242
- def _ack_generator(self, id: str) -> Callable[[], Awaitable[None]]:
242
+ def _ack_generator(self, id: str, queue_name: str) -> Callable[[], Awaitable[None]]:
243
243
  async def _ack() -> None:
244
244
  async with self._acquire_master_conn() as redis_conn:
245
245
  await redis_conn.xack(
246
- self.queue_name,
246
+ queue_name,
247
247
  self.consumer_group_name,
248
248
  id,
249
249
  )
@@ -264,10 +264,10 @@ class RedisStreamSentinelBroker(BaseSentinelBroker):
264
264
  block=self.block,
265
265
  noack=False,
266
266
  )
267
- for _, msg_list in fetched:
267
+ for stream, msg_list in fetched:
268
268
  for msg_id, msg in msg_list:
269
269
  logger.debug("Received message: %s", msg)
270
270
  yield AckableMessage(
271
271
  data=msg[b"data"],
272
- ack=self._ack_generator(msg_id),
272
+ ack=self._ack_generator(id=msg_id, queue_name=stream),
273
273
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: taskiq-redis
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Redis integration for taskiq
5
5
  License-File: LICENSE
6
6
  Keywords: taskiq,tasks,distributed,async,redis,result_backend
@@ -3,11 +3,11 @@ taskiq_redis/exceptions.py,sha256=7buBJ7CRVWd5WqVqSjtHO8cVL7QzZg-DOM3nB87t-Sk,73
3
3
  taskiq_redis/list_schedule_source.py,sha256=aMM_LCJrbg2GIb8BTJJEZaFIWxziR68TwGELMTKI1q8,9805
4
4
  taskiq_redis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  taskiq_redis/redis_backend.py,sha256=sE4XeGr1fX0IE5FBdCJ9uP6DH7khAKlt8va2SwTv4go,19850
6
- taskiq_redis/redis_broker.py,sha256=2FqE3xbQcFW_BBsa4RBCl3hLUIcamR70Sc5Pjen-O8A,12278
7
- taskiq_redis/redis_cluster_broker.py,sha256=pJfTIMTKg5h0qeS1ia-8R98Yk0zAVseM7ZRZnGTlMGU,7232
8
- taskiq_redis/redis_sentinel_broker.py,sha256=SxOLXzK6RuInYoS27fSeZac0N1i52sFBig4s5owaU80,9666
6
+ taskiq_redis/redis_broker.py,sha256=COVKtKTy9JTqwwKr0FY4DGbv_CU1aEcYa0hrZNbvQpc,12339
7
+ taskiq_redis/redis_cluster_broker.py,sha256=Kcp2bsrarEcwDfrPnk52iiEpT5HOdnrCbeT79i0xNgY,7271
8
+ taskiq_redis/redis_sentinel_broker.py,sha256=D3EVc2-mpOayU8IYvqeBeGJxNr1rBX4ElQrU0R-CJoA,9705
9
9
  taskiq_redis/schedule_source.py,sha256=mDYlAlAuzIzMICpJiQ1AwWOF-9_OHVGJWXA45Gm2Trg,10128
10
- taskiq_redis-1.1.1.dist-info/METADATA,sha256=LLaOkXmBNm1paLyUTn4G1kpAgHfDDAfLbr-HkWNFEhk,7205
11
- taskiq_redis-1.1.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
12
- taskiq_redis-1.1.1.dist-info/licenses/LICENSE,sha256=lEHEEE-ZxmuItxYgUMPiFWdRcAITxE8DFMNyAg4eOYE,1075
13
- taskiq_redis-1.1.1.dist-info/RECORD,,
10
+ taskiq_redis-1.1.2.dist-info/METADATA,sha256=ln415QqFA3Il9AfBx-htyw0KhCdLDYHCipJExCihfLg,7205
11
+ taskiq_redis-1.1.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
12
+ taskiq_redis-1.1.2.dist-info/licenses/LICENSE,sha256=lEHEEE-ZxmuItxYgUMPiFWdRcAITxE8DFMNyAg4eOYE,1075
13
+ taskiq_redis-1.1.2.dist-info/RECORD,,