python-cq 0.1.0__tar.gz → 0.1.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-cq
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Lightweight CQRS library.
5
5
  Home-page: https://github.com/100nm/python-cq
6
6
  License: MIT
@@ -19,7 +19,7 @@ class MiddlewareGroup[**P, T]:
19
19
  return iter(self.__middlewares)
20
20
 
21
21
  def add(self, *middlewares: Middleware[P, T]) -> Self:
22
- self.__middlewares.extend(middlewares)
22
+ self.__middlewares.extend(reversed(middlewares))
23
23
  return self
24
24
 
25
25
  async def invoke(
@@ -44,12 +44,13 @@ class MiddlewareGroup[**P, T]:
44
44
  try:
45
45
  await anext(generator)
46
46
 
47
- try:
48
- value = await handler(*args, **kwargs)
49
- except BaseException as exc:
50
- await generator.athrow(exc)
51
- else:
52
- await generator.asend(value)
47
+ while True:
48
+ try:
49
+ value = await handler(*args, **kwargs)
50
+ except BaseException as exc:
51
+ await generator.athrow(exc)
52
+ else:
53
+ await generator.asend(value)
53
54
 
54
55
  except StopAsyncIteration:
55
56
  ...
File without changes
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-cq"
3
- version = "0.1.0"
3
+ version = "0.1.2"
4
4
  description = "Lightweight CQRS library."
5
5
  license = "MIT"
6
6
  authors = ["remimd"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes