jararaca 0.3.11a3__py3-none-any.whl → 0.3.11a5__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.
Potentially problematic release.
This version of jararaca might be problematic. Click here for more details.
- jararaca/__init__.py +73 -2
- jararaca/cli.py +2 -2
- jararaca/core/uow.py +17 -12
- jararaca/messagebus/decorators.py +31 -30
- jararaca/messagebus/interceptors/publisher_interceptor.py +5 -3
- jararaca/messagebus/worker.py +13 -6
- jararaca/messagebus/worker_v2.py +21 -26
- jararaca/microservice.py +61 -18
- jararaca/observability/decorators.py +7 -3
- jararaca/observability/interceptor.py +4 -2
- jararaca/observability/providers/otel.py +14 -10
- jararaca/persistence/base.py +2 -1
- jararaca/persistence/interceptors/aiosqa_interceptor.py +167 -16
- jararaca/presentation/decorators.py +96 -10
- jararaca/presentation/server.py +31 -4
- jararaca/presentation/websocket/websocket_interceptor.py +4 -2
- jararaca/reflect/__init__.py +0 -0
- jararaca/reflect/controller_inspect.py +75 -0
- jararaca/{tools → reflect}/metadata.py +25 -5
- jararaca/scheduler/decorators.py +48 -20
- jararaca/scheduler/scheduler.py +27 -22
- jararaca/scheduler/scheduler_v2.py +20 -16
- jararaca/tools/app_config/interceptor.py +4 -2
- {jararaca-0.3.11a3.dist-info → jararaca-0.3.11a5.dist-info}/METADATA +2 -1
- {jararaca-0.3.11a3.dist-info → jararaca-0.3.11a5.dist-info}/RECORD +28 -26
- {jararaca-0.3.11a3.dist-info → jararaca-0.3.11a5.dist-info}/LICENSE +0 -0
- {jararaca-0.3.11a3.dist-info → jararaca-0.3.11a5.dist-info}/WHEEL +0 -0
- {jararaca-0.3.11a3.dist-info → jararaca-0.3.11a5.dist-info}/entry_points.txt +0 -0
|
@@ -13,9 +13,9 @@ from pydantic import BaseModel
|
|
|
13
13
|
from jararaca.core.uow import UnitOfWorkContextProvider
|
|
14
14
|
from jararaca.di import Container
|
|
15
15
|
from jararaca.microservice import (
|
|
16
|
-
AppContext,
|
|
17
16
|
AppInterceptor,
|
|
18
17
|
AppInterceptorWithLifecycle,
|
|
18
|
+
AppTransactionContext,
|
|
19
19
|
Microservice,
|
|
20
20
|
)
|
|
21
21
|
from jararaca.presentation.decorators import (
|
|
@@ -185,7 +185,9 @@ class WebSocketInterceptor(AppInterceptor, AppInterceptorWithLifecycle):
|
|
|
185
185
|
self.shutdown_event.set()
|
|
186
186
|
|
|
187
187
|
@asynccontextmanager
|
|
188
|
-
async def intercept(
|
|
188
|
+
async def intercept(
|
|
189
|
+
self, app_context: AppTransactionContext
|
|
190
|
+
) -> AsyncGenerator[None, None]:
|
|
189
191
|
|
|
190
192
|
staging_ws_messages_sender = StagingWebSocketMessageSender(
|
|
191
193
|
self.connection_manager
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Any, Callable, Mapping, Tuple, Type
|
|
4
|
+
|
|
5
|
+
from frozendict import frozendict
|
|
6
|
+
|
|
7
|
+
from jararaca.reflect.metadata import ControllerInstanceMetadata, SetMetadata
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass(frozen=True)
|
|
11
|
+
class ControllerReflect:
|
|
12
|
+
|
|
13
|
+
controller_class: Type[Any]
|
|
14
|
+
metadata: Mapping[str, ControllerInstanceMetadata]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass(frozen=True)
|
|
18
|
+
class ControllerMemberReflect:
|
|
19
|
+
controller_reflect: ControllerReflect
|
|
20
|
+
member_function: Callable[..., Any]
|
|
21
|
+
metadata: Mapping[str, ControllerInstanceMetadata]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def inspect_controller(
|
|
25
|
+
controller: Type[Any],
|
|
26
|
+
) -> Tuple[ControllerReflect, Mapping[str, ControllerMemberReflect]]:
|
|
27
|
+
"""
|
|
28
|
+
Inspect a controller class to extract its metadata and member functions.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
controller (Type[Any]): The controller class to inspect.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
Tuple[ControllerReflect, list[ControllerMemberReflect]]: A tuple containing the controller reflect and a list of member reflects.
|
|
35
|
+
"""
|
|
36
|
+
controller_metadata_list = SetMetadata.get(controller)
|
|
37
|
+
|
|
38
|
+
controller_metadata_map = frozendict(
|
|
39
|
+
{
|
|
40
|
+
metadata.key: ControllerInstanceMetadata(
|
|
41
|
+
value=metadata.value, inherited=False
|
|
42
|
+
)
|
|
43
|
+
for metadata in controller_metadata_list
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
controller_reflect = ControllerReflect(
|
|
48
|
+
controller_class=controller, metadata=controller_metadata_map
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
members = {
|
|
52
|
+
name: ControllerMemberReflect(
|
|
53
|
+
controller_reflect=controller_reflect,
|
|
54
|
+
member_function=member,
|
|
55
|
+
metadata=frozendict(
|
|
56
|
+
{
|
|
57
|
+
**{
|
|
58
|
+
key: ControllerInstanceMetadata(
|
|
59
|
+
value=value.value, inherited=True
|
|
60
|
+
)
|
|
61
|
+
for key, value in controller_metadata_map.items()
|
|
62
|
+
},
|
|
63
|
+
**{
|
|
64
|
+
metadata.key: ControllerInstanceMetadata(
|
|
65
|
+
value=metadata.value, inherited=False
|
|
66
|
+
)
|
|
67
|
+
for metadata in SetMetadata.get(member)
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
)
|
|
72
|
+
for name, member in inspect.getmembers(controller, predicate=inspect.isfunction)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return controller_reflect, members
|
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
from contextlib import contextmanager, suppress
|
|
2
2
|
from contextvars import ContextVar
|
|
3
|
-
from
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Awaitable, Callable, Mapping, TypeVar, Union, cast
|
|
4
5
|
|
|
5
6
|
DECORATED = TypeVar("DECORATED", bound=Union[Callable[..., Awaitable[Any]], type])
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
@dataclass
|
|
10
|
+
class ControllerInstanceMetadata:
|
|
11
|
+
value: Any
|
|
12
|
+
inherited: bool
|
|
9
13
|
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
metadata_context: ContextVar[Mapping[str, ControllerInstanceMetadata]] = ContextVar(
|
|
16
|
+
"metadata_context"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_metadata(key: str) -> ControllerInstanceMetadata | None:
|
|
12
21
|
return metadata_context.get({}).get(key)
|
|
13
22
|
|
|
14
23
|
|
|
24
|
+
def get_metadata_value(key: str, default: Any | None = None) -> Any:
|
|
25
|
+
metadata = get_metadata(key)
|
|
26
|
+
if metadata is None:
|
|
27
|
+
return default
|
|
28
|
+
return metadata.value
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def get_all_metadata() -> Mapping[str, ControllerInstanceMetadata]:
|
|
32
|
+
return metadata_context.get({})
|
|
33
|
+
|
|
34
|
+
|
|
15
35
|
@contextmanager
|
|
16
|
-
def provide_metadata(metadata:
|
|
36
|
+
def provide_metadata(metadata: Mapping[str, ControllerInstanceMetadata]) -> Any:
|
|
17
37
|
|
|
18
38
|
current_metadata = metadata_context.get({})
|
|
19
39
|
|
|
@@ -39,7 +59,7 @@ class SetMetadata:
|
|
|
39
59
|
setattr(cls, SetMetadata.METATADA_LIST, metadata_list)
|
|
40
60
|
|
|
41
61
|
@staticmethod
|
|
42
|
-
def get(cls:
|
|
62
|
+
def get(cls: DECORATED) -> "list[SetMetadata]":
|
|
43
63
|
return cast(list[SetMetadata], getattr(cls, SetMetadata.METATADA_LIST, []))
|
|
44
64
|
|
|
45
65
|
def __call__(self, cls: DECORATED) -> DECORATED:
|
jararaca/scheduler/decorators.py
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import inspect
|
|
2
|
-
from
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Any, Awaitable, Callable, TypeVar, cast
|
|
4
|
+
|
|
5
|
+
from jararaca.reflect.controller_inspect import (
|
|
6
|
+
ControllerMemberReflect,
|
|
7
|
+
inspect_controller,
|
|
8
|
+
)
|
|
3
9
|
|
|
4
10
|
DECORATED_FUNC = TypeVar("DECORATED_FUNC", bound=Callable[..., Any])
|
|
5
11
|
|
|
@@ -66,25 +72,6 @@ class ScheduledAction:
|
|
|
66
72
|
ScheduledAction, getattr(func, ScheduledAction.SCHEDULED_ACTION_ATTR)
|
|
67
73
|
)
|
|
68
74
|
|
|
69
|
-
@staticmethod
|
|
70
|
-
def get_type_scheduled_actions(
|
|
71
|
-
instance: Any,
|
|
72
|
-
) -> list[tuple[Callable[..., Any], "ScheduledAction"]]:
|
|
73
|
-
|
|
74
|
-
members = inspect.getmembers(instance, predicate=inspect.ismethod)
|
|
75
|
-
|
|
76
|
-
scheduled_actions: list[tuple[Callable[..., Any], "ScheduledAction"]] = []
|
|
77
|
-
|
|
78
|
-
for _, member in members:
|
|
79
|
-
scheduled_action = ScheduledAction.get_scheduled_action(member)
|
|
80
|
-
|
|
81
|
-
if scheduled_action is None:
|
|
82
|
-
continue
|
|
83
|
-
|
|
84
|
-
scheduled_actions.append((member, scheduled_action))
|
|
85
|
-
|
|
86
|
-
return scheduled_actions
|
|
87
|
-
|
|
88
75
|
@staticmethod
|
|
89
76
|
def get_function_id(
|
|
90
77
|
func: Callable[..., Any],
|
|
@@ -94,3 +81,44 @@ class ScheduledAction:
|
|
|
94
81
|
This is used to identify the scheduled action in the message broker.
|
|
95
82
|
"""
|
|
96
83
|
return f"{func.__module__}.{func.__qualname__}"
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass(frozen=True)
|
|
87
|
+
class ScheduledActionData:
|
|
88
|
+
spec: ScheduledAction
|
|
89
|
+
controller_member: ControllerMemberReflect
|
|
90
|
+
callable: Callable[..., Awaitable[None]]
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def get_type_scheduled_actions(
|
|
94
|
+
instance: Any,
|
|
95
|
+
) -> list[ScheduledActionData]:
|
|
96
|
+
|
|
97
|
+
_, member_metadata_map = inspect_controller(instance.__class__)
|
|
98
|
+
|
|
99
|
+
members = inspect.getmembers(instance, predicate=inspect.ismethod)
|
|
100
|
+
|
|
101
|
+
scheduled_actions: list[ScheduledActionData] = []
|
|
102
|
+
|
|
103
|
+
for name, member in members:
|
|
104
|
+
scheduled_action = ScheduledAction.get_scheduled_action(member)
|
|
105
|
+
|
|
106
|
+
if scheduled_action is None:
|
|
107
|
+
continue
|
|
108
|
+
|
|
109
|
+
if name not in member_metadata_map:
|
|
110
|
+
raise Exception(
|
|
111
|
+
f"Member '{name}' is not a valid controller member in '{instance.__class__.__name__}'"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
member_metadata = member_metadata_map[name]
|
|
115
|
+
|
|
116
|
+
scheduled_actions.append(
|
|
117
|
+
ScheduledActionData(
|
|
118
|
+
callable=member,
|
|
119
|
+
spec=scheduled_action,
|
|
120
|
+
controller_member=member_metadata,
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return scheduled_actions
|
jararaca/scheduler/scheduler.py
CHANGED
|
@@ -14,8 +14,16 @@ from jararaca.core.uow import UnitOfWorkContextProvider
|
|
|
14
14
|
from jararaca.di import Container
|
|
15
15
|
from jararaca.lifecycle import AppLifecycle
|
|
16
16
|
from jararaca.messagebus.decorators import ScheduleDispatchData
|
|
17
|
-
from jararaca.microservice import
|
|
18
|
-
|
|
17
|
+
from jararaca.microservice import (
|
|
18
|
+
AppTransactionContext,
|
|
19
|
+
Microservice,
|
|
20
|
+
SchedulerTransactionData,
|
|
21
|
+
)
|
|
22
|
+
from jararaca.scheduler.decorators import (
|
|
23
|
+
ScheduledAction,
|
|
24
|
+
ScheduledActionData,
|
|
25
|
+
get_type_scheduled_actions,
|
|
26
|
+
)
|
|
19
27
|
|
|
20
28
|
logger = logging.getLogger(__name__)
|
|
21
29
|
|
|
@@ -27,15 +35,13 @@ class SchedulerConfig:
|
|
|
27
35
|
|
|
28
36
|
def extract_scheduled_actions(
|
|
29
37
|
app: Microservice, container: Container
|
|
30
|
-
) -> list[
|
|
31
|
-
scheduled_actions: list[
|
|
38
|
+
) -> list[ScheduledActionData]:
|
|
39
|
+
scheduled_actions: list[ScheduledActionData] = []
|
|
32
40
|
for controllers in app.controllers:
|
|
33
41
|
|
|
34
42
|
controller_instance: Any = container.get_by_type(controllers)
|
|
35
43
|
|
|
36
|
-
controller_scheduled_actions =
|
|
37
|
-
controller_instance
|
|
38
|
-
)
|
|
44
|
+
controller_scheduled_actions = get_type_scheduled_actions(controller_instance)
|
|
39
45
|
scheduled_actions.extend(controller_scheduled_actions)
|
|
40
46
|
|
|
41
47
|
return scheduled_actions
|
|
@@ -68,19 +74,16 @@ class Scheduler:
|
|
|
68
74
|
|
|
69
75
|
self.lifceycle = AppLifecycle(app, self.container)
|
|
70
76
|
|
|
71
|
-
async def process_task(
|
|
72
|
-
self, func: Callable[..., Any], scheduled_action: ScheduledAction
|
|
73
|
-
) -> None:
|
|
77
|
+
async def process_task(self, sched_act_data: ScheduledActionData) -> None:
|
|
74
78
|
|
|
75
79
|
async with self.lock:
|
|
76
|
-
task = asyncio.create_task(self.handle_task(
|
|
80
|
+
task = asyncio.create_task(self.handle_task(sched_act_data))
|
|
77
81
|
self.tasks.add(task)
|
|
78
82
|
task.add_done_callback(self.tasks.discard)
|
|
79
83
|
|
|
80
|
-
async def handle_task(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
async def handle_task(self, sched_act_data: ScheduledActionData) -> None:
|
|
85
|
+
func = sched_act_data.callable
|
|
86
|
+
scheduled_action = sched_act_data.spec
|
|
84
87
|
last_check = self.last_checks.setdefault(func, datetime.now(UTC))
|
|
85
88
|
|
|
86
89
|
cron = croniter(scheduled_action.cron, last_check)
|
|
@@ -105,11 +108,13 @@ class Scheduler:
|
|
|
105
108
|
|
|
106
109
|
try:
|
|
107
110
|
async with self.uow_provider(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
app_context=AppTransactionContext(
|
|
112
|
+
controller_member_reflect=sched_act_data.controller_member,
|
|
113
|
+
transaction_data=SchedulerTransactionData(
|
|
114
|
+
scheduled_to=next_run,
|
|
115
|
+
cron_expression=scheduled_action.cron,
|
|
116
|
+
triggered_at=datetime.now(UTC),
|
|
117
|
+
),
|
|
113
118
|
)
|
|
114
119
|
):
|
|
115
120
|
try:
|
|
@@ -144,11 +149,11 @@ class Scheduler:
|
|
|
144
149
|
scheduled_actions = extract_scheduled_actions(self.app, self.container)
|
|
145
150
|
|
|
146
151
|
while True:
|
|
147
|
-
for
|
|
152
|
+
for action in scheduled_actions:
|
|
148
153
|
if self.shutdown_event.is_set():
|
|
149
154
|
break
|
|
150
155
|
|
|
151
|
-
await self.process_task(
|
|
156
|
+
await self.process_task(action)
|
|
152
157
|
|
|
153
158
|
await asyncio.sleep(self.interval)
|
|
154
159
|
|
|
@@ -7,7 +7,7 @@ from abc import ABC, abstractmethod
|
|
|
7
7
|
from contextlib import asynccontextmanager
|
|
8
8
|
from datetime import UTC, datetime
|
|
9
9
|
from types import FrameType
|
|
10
|
-
from typing import Any, AsyncGenerator
|
|
10
|
+
from typing import Any, AsyncGenerator
|
|
11
11
|
from urllib.parse import parse_qs
|
|
12
12
|
|
|
13
13
|
import aio_pika
|
|
@@ -25,25 +25,25 @@ from jararaca.core.uow import UnitOfWorkContextProvider
|
|
|
25
25
|
from jararaca.di import Container
|
|
26
26
|
from jararaca.lifecycle import AppLifecycle
|
|
27
27
|
from jararaca.microservice import Microservice
|
|
28
|
-
from jararaca.scheduler.decorators import
|
|
28
|
+
from jararaca.scheduler.decorators import (
|
|
29
|
+
ScheduledAction,
|
|
30
|
+
ScheduledActionData,
|
|
31
|
+
get_type_scheduled_actions,
|
|
32
|
+
)
|
|
29
33
|
from jararaca.scheduler.types import DelayedMessageData
|
|
30
34
|
|
|
31
35
|
logger = logging.getLogger(__name__)
|
|
32
36
|
|
|
33
|
-
SCHEDULED_ACTION_LIST = list[tuple[Callable[..., Any], "ScheduledAction"]]
|
|
34
|
-
|
|
35
37
|
|
|
36
38
|
def extract_scheduled_actions(
|
|
37
39
|
app: Microservice, container: Container
|
|
38
|
-
) ->
|
|
39
|
-
scheduled_actions:
|
|
40
|
+
) -> list[ScheduledActionData]:
|
|
41
|
+
scheduled_actions: list[ScheduledActionData] = []
|
|
40
42
|
for controllers in app.controllers:
|
|
41
43
|
|
|
42
44
|
controller_instance: Any = container.get_by_type(controllers)
|
|
43
45
|
|
|
44
|
-
controller_scheduled_actions =
|
|
45
|
-
controller_instance
|
|
46
|
-
)
|
|
46
|
+
controller_scheduled_actions = get_type_scheduled_actions(controller_instance)
|
|
47
47
|
scheduled_actions.extend(controller_scheduled_actions)
|
|
48
48
|
|
|
49
49
|
return scheduled_actions
|
|
@@ -81,7 +81,7 @@ class MessageBrokerDispatcher(ABC):
|
|
|
81
81
|
raise NotImplementedError("dispatch_delayed_message() is not implemented yet.")
|
|
82
82
|
|
|
83
83
|
@abstractmethod
|
|
84
|
-
async def initialize(self, scheduled_actions:
|
|
84
|
+
async def initialize(self, scheduled_actions: list[ScheduledActionData]) -> None:
|
|
85
85
|
raise NotImplementedError("initialize() is not implemented yet.")
|
|
86
86
|
|
|
87
87
|
async def dispose(self) -> None:
|
|
@@ -171,7 +171,7 @@ class RabbitMQBrokerDispatcher(MessageBrokerDispatcher):
|
|
|
171
171
|
routing_key=f"{delayed_message.message_topic}.",
|
|
172
172
|
)
|
|
173
173
|
|
|
174
|
-
async def initialize(self, scheduled_actions:
|
|
174
|
+
async def initialize(self, scheduled_actions: list[ScheduledActionData]) -> None:
|
|
175
175
|
"""
|
|
176
176
|
Initialize the RabbitMQ server.
|
|
177
177
|
This is used to create the exchange and queues for the scheduled actions.
|
|
@@ -188,15 +188,17 @@ class RabbitMQBrokerDispatcher(MessageBrokerDispatcher):
|
|
|
188
188
|
auto_delete=False,
|
|
189
189
|
)
|
|
190
190
|
|
|
191
|
-
for
|
|
191
|
+
for sched_act_data in scheduled_actions:
|
|
192
192
|
queue = await channel.declare_queue(
|
|
193
|
-
name=ScheduledAction.get_function_id(
|
|
193
|
+
name=ScheduledAction.get_function_id(sched_act_data.callable),
|
|
194
194
|
durable=True,
|
|
195
195
|
)
|
|
196
196
|
|
|
197
197
|
await queue.bind(
|
|
198
198
|
exchange=self.exchange,
|
|
199
|
-
routing_key=ScheduledAction.get_function_id(
|
|
199
|
+
routing_key=ScheduledAction.get_function_id(
|
|
200
|
+
sched_act_data.callable
|
|
201
|
+
),
|
|
200
202
|
)
|
|
201
203
|
|
|
202
204
|
async def dispose(self) -> None:
|
|
@@ -269,12 +271,14 @@ class SchedulerV2:
|
|
|
269
271
|
await self.run_scheduled_actions(scheduled_actions)
|
|
270
272
|
|
|
271
273
|
async def run_scheduled_actions(
|
|
272
|
-
self, scheduled_actions:
|
|
274
|
+
self, scheduled_actions: list[ScheduledActionData]
|
|
273
275
|
) -> None:
|
|
274
276
|
|
|
275
277
|
while not self.shutdown_event.is_set():
|
|
276
278
|
now = int(time.time())
|
|
277
|
-
for
|
|
279
|
+
for sched_act_data in scheduled_actions:
|
|
280
|
+
func = sched_act_data.callable
|
|
281
|
+
scheduled_action = sched_act_data.spec
|
|
278
282
|
if self.shutdown_event.is_set():
|
|
279
283
|
break
|
|
280
284
|
|
|
@@ -7,9 +7,9 @@ from pydantic import BaseModel
|
|
|
7
7
|
|
|
8
8
|
from jararaca.core.providers import Token
|
|
9
9
|
from jararaca.microservice import (
|
|
10
|
-
AppContext,
|
|
11
10
|
AppInterceptor,
|
|
12
11
|
AppInterceptorWithLifecycle,
|
|
12
|
+
AppTransactionContext,
|
|
13
13
|
Container,
|
|
14
14
|
Microservice,
|
|
15
15
|
)
|
|
@@ -40,7 +40,9 @@ class AppConfigurationInterceptor(AppInterceptor, AppInterceptorWithLifecycle):
|
|
|
40
40
|
self.config_parser = config_parser
|
|
41
41
|
|
|
42
42
|
@asynccontextmanager
|
|
43
|
-
async def intercept(
|
|
43
|
+
async def intercept(
|
|
44
|
+
self, app_context: AppTransactionContext
|
|
45
|
+
) -> AsyncGenerator[None, None]:
|
|
44
46
|
yield
|
|
45
47
|
|
|
46
48
|
def instance_basemodels(self, basemodel_type: Type[BaseModel]) -> BaseModel:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: jararaca
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.11a5
|
|
4
4
|
Summary: A simple and fast API framework for Python
|
|
5
5
|
Author: Lucas S
|
|
6
6
|
Author-email: me@luscasleo.dev
|
|
@@ -16,6 +16,7 @@ Provides-Extra: watch
|
|
|
16
16
|
Requires-Dist: aio-pika (>=9.4.3,<10.0.0)
|
|
17
17
|
Requires-Dist: croniter (>=3.0.3,<4.0.0)
|
|
18
18
|
Requires-Dist: fastapi (>=0.113.0,<0.114.0)
|
|
19
|
+
Requires-Dist: frozendict (>=2.4.6,<3.0.0)
|
|
19
20
|
Requires-Dist: mako (>=1.3.5,<2.0.0)
|
|
20
21
|
Requires-Dist: opentelemetry-api (>=1.27.0,<2.0.0) ; extra == "opentelemetry"
|
|
21
22
|
Requires-Dist: opentelemetry-distro (>=0.49b2,<0.50) ; extra == "opentelemetry"
|
|
@@ -1,52 +1,55 @@
|
|
|
1
|
-
jararaca/__init__.py,sha256=
|
|
1
|
+
jararaca/__init__.py,sha256=cBEuhv_EnQiFj-fYilfyGbX0KRxiUpxmY6V4ytp04_o,17961
|
|
2
2
|
jararaca/__main__.py,sha256=-O3vsB5lHdqNFjUtoELDF81IYFtR-DSiiFMzRaiSsv4,67
|
|
3
3
|
jararaca/broker_backend/__init__.py,sha256=GzEIuHR1xzgCJD4FE3harNjoaYzxHMHoEL0_clUaC-k,3528
|
|
4
4
|
jararaca/broker_backend/mapper.py,sha256=vTsi7sWpNvlga1PWPFg0rCJ5joJ0cdzykkIc2Tuvenc,696
|
|
5
5
|
jararaca/broker_backend/redis_broker_backend.py,sha256=a7DHchy3NAiD71Ix8SwmQOUnniu7uup-Woa4ON_4J7I,5786
|
|
6
|
-
jararaca/cli.py,sha256=
|
|
6
|
+
jararaca/cli.py,sha256=y3PhnhSdzwE-F1OTK-VJetZfxosQyDkrtiGgZgLQGD8,24707
|
|
7
7
|
jararaca/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
jararaca/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
jararaca/core/providers.py,sha256=wktH84FK7c1s2wNq-fudf1uMfi3CQBR0neU2czJ_L0U,434
|
|
10
|
-
jararaca/core/uow.py,sha256=
|
|
10
|
+
jararaca/core/uow.py,sha256=jKlhU_YsssiN0hC1s056JcNerNagXPcXdZJ5kJYG68c,2252
|
|
11
11
|
jararaca/di.py,sha256=h3IsXdYZjJj8PJfnEDn0ZAwdd4EBfh8jU-wWO8ko_t4,76
|
|
12
12
|
jararaca/files/entity.py.mako,sha256=tjQ-1udAMvVqgRokhsrR4uy3P_OVnbk3XZ8X69ixWhE,3098
|
|
13
13
|
jararaca/lifecycle.py,sha256=qKlzLQQioS8QkxNJ_FC_5WbmT77cNbc_S7OcQeOoHkI,1895
|
|
14
14
|
jararaca/messagebus/__init__.py,sha256=5jAqPqdcEMYBfQyfZDWPnplYdrfMyJLMcacf3qLyUhk,56
|
|
15
15
|
jararaca/messagebus/bus_message_controller.py,sha256=Xd_qwnX5jUvgBTCarHR36fvtol9lPTsYp2IIGKyQQaE,1487
|
|
16
16
|
jararaca/messagebus/consumers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
jararaca/messagebus/decorators.py,sha256=
|
|
17
|
+
jararaca/messagebus/decorators.py,sha256=pNefkrfTFuhRQQzmfL7MSKcVa55b0TUHqEtKPunxoAA,5847
|
|
18
18
|
jararaca/messagebus/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
jararaca/messagebus/interceptors/aiopika_publisher_interceptor.py,sha256=_DEHwIH9LYsA26Hu1mo9oHzLZuATgjilU9E3o-ecDjs,6520
|
|
20
|
-
jararaca/messagebus/interceptors/publisher_interceptor.py,sha256=
|
|
20
|
+
jararaca/messagebus/interceptors/publisher_interceptor.py,sha256=ojy1bRhqMgrkQljcGGS8cd8-8pUjL8ZHjIUkdmaAnNM,1325
|
|
21
21
|
jararaca/messagebus/message.py,sha256=U6cyd2XknX8mtm0333slz5fanky2PFLWCmokAO56vvU,819
|
|
22
22
|
jararaca/messagebus/publisher.py,sha256=JTkxdKbvxvDWT8nK8PVEyyX061vYYbKQMxRHXrZtcEY,2173
|
|
23
|
-
jararaca/messagebus/worker.py,sha256=
|
|
24
|
-
jararaca/messagebus/worker_v2.py,sha256=
|
|
25
|
-
jararaca/microservice.py,sha256=
|
|
26
|
-
jararaca/observability/decorators.py,sha256=
|
|
27
|
-
jararaca/observability/interceptor.py,sha256=
|
|
23
|
+
jararaca/messagebus/worker.py,sha256=IMMI5NCVYnXmETFgFymkFJj-dGUHM0WQUZXNItfW5cY,14018
|
|
24
|
+
jararaca/messagebus/worker_v2.py,sha256=M8bN_9L1mo_uzJDut90WgKv3okwrzfKg4jD6jUFcBvA,20904
|
|
25
|
+
jararaca/microservice.py,sha256=jTGzkoJcco1nXwZZDeHRwEHAu_Hpr5gxA_d51P49C2c,7915
|
|
26
|
+
jararaca/observability/decorators.py,sha256=MOIr2PttPYYvRwEdfQZEwD5RxKHOTv8UEy9n1YQVoKw,2281
|
|
27
|
+
jararaca/observability/interceptor.py,sha256=U4ZLM0f8j6Q7gMUKKnA85bnvD-Qa0ii79Qa_X8KsXAQ,1498
|
|
28
28
|
jararaca/observability/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
-
jararaca/observability/providers/otel.py,sha256=
|
|
30
|
-
jararaca/persistence/base.py,sha256=
|
|
29
|
+
jararaca/observability/providers/otel.py,sha256=8N1F32W43t7c8cwmtTh6Yz9b7HyfGFSRVrkMLf3NDXc,6157
|
|
30
|
+
jararaca/persistence/base.py,sha256=xnGUbsLNz3gO-9iJt-Sn5NY13Yc9-misP8wLwQuGGoM,1024
|
|
31
31
|
jararaca/persistence/exports.py,sha256=Ghx4yoFaB4QVTb9WxrFYgmcSATXMNvrOvT8ybPNKXCA,62
|
|
32
32
|
jararaca/persistence/interceptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=
|
|
33
|
+
jararaca/persistence/interceptors/aiosqa_interceptor.py,sha256=LYuKNHYa1CSqJGh-n9iXHT0y73anAbb_DMhyEsjP7bI,6597
|
|
34
34
|
jararaca/persistence/session.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
jararaca/persistence/sort_filter.py,sha256=agggpN0YvNjUr6wJjy69NkaqxoDDW13ys9B3r85OujA,9226
|
|
36
36
|
jararaca/persistence/utilities.py,sha256=imcV4Oi5kXNk6m9QF2-OsnFpcTRY4w5mBYLdEx5XTSQ,14296
|
|
37
37
|
jararaca/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
-
jararaca/presentation/decorators.py,sha256=
|
|
38
|
+
jararaca/presentation/decorators.py,sha256=dNcK1xYWhdHVBeWDa8dhqh4z8yQcPkJZTQkfgLXz6RI,11655
|
|
39
39
|
jararaca/presentation/hooks.py,sha256=WBbU5DG3-MAm2Ro2YraQyYG_HENfizYfyShL2ktHi6k,1980
|
|
40
40
|
jararaca/presentation/http_microservice.py,sha256=g771JosV6jTY3hQtG-HkLOo-T0e-r3b3rp1ddt99Qf0,533
|
|
41
|
-
jararaca/presentation/server.py,sha256=
|
|
41
|
+
jararaca/presentation/server.py,sha256=5joE17nnSiwR497Nerr-vcthKL4NRBzyf1KWM8DFgwQ,4682
|
|
42
42
|
jararaca/presentation/websocket/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
jararaca/presentation/websocket/base_types.py,sha256=AvUeeZ1TFhSiRMcYqZU1HaQNqSrcgTkC5R0ArP5dGmA,146
|
|
44
44
|
jararaca/presentation/websocket/context.py,sha256=A6K5W3kqo9Hgeh1m6JiI7Cdz5SfbXcaICSVX7u1ARZo,1903
|
|
45
45
|
jararaca/presentation/websocket/decorators.py,sha256=ZNd5aoA9UkyfHOt1C8D2Ffy2gQUNDEsusVnQuTgExgs,2157
|
|
46
46
|
jararaca/presentation/websocket/redis.py,sha256=6wD4zGHftJXNDW3VfS65WJt2cnOgTI0zmQOfjZ_CEXE,4726
|
|
47
47
|
jararaca/presentation/websocket/types.py,sha256=M8snAMSdaQlKrwEM2qOgF2qrefo5Meio_oOw620Joc8,308
|
|
48
|
-
jararaca/presentation/websocket/websocket_interceptor.py,sha256=
|
|
48
|
+
jararaca/presentation/websocket/websocket_interceptor.py,sha256=JWn_G8Q2WO0-1kmN7-Gv0HkIM6nZ_yjCdGRuXUS8F7A,9191
|
|
49
49
|
jararaca/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
jararaca/reflect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
|
+
jararaca/reflect/controller_inspect.py,sha256=UtV4pRIOqCoK4ogBTXQE0dyopEQ5LDFhwm-1iJvrkJc,2326
|
|
52
|
+
jararaca/reflect/metadata.py,sha256=oTi0zIjCYkeBhs12PNTLc8GmzR6qWHdl3drlmamXLJo,1897
|
|
50
53
|
jararaca/rpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
54
|
jararaca/rpc/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
55
|
jararaca/rpc/http/backends/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -55,19 +58,18 @@ jararaca/rpc/http/backends/otel.py,sha256=Uc6CjHSCZ5hvnK1fNFv3ota5xzUFnvIl1JOpG3
|
|
|
55
58
|
jararaca/rpc/http/decorators.py,sha256=oUSzgMGI8w6SoKiz3GltDbd3BWAuyY60F23cdRRNeiw,11897
|
|
56
59
|
jararaca/rpc/http/httpx.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
60
|
jararaca/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
58
|
-
jararaca/scheduler/decorators.py,sha256=
|
|
59
|
-
jararaca/scheduler/scheduler.py,sha256=
|
|
60
|
-
jararaca/scheduler/scheduler_v2.py,sha256=
|
|
61
|
+
jararaca/scheduler/decorators.py,sha256=ZvOMzQT1ypU7xRLuhu6YARek1YFQ69kje2NdGjlppY8,4325
|
|
62
|
+
jararaca/scheduler/scheduler.py,sha256=PjX40P09tAeD77Z0f4U1XkW782aDk_1GlUXoLaEWXe8,5446
|
|
63
|
+
jararaca/scheduler/scheduler_v2.py,sha256=Ipwgsoirate3xwsoKD-Hd6vxZplSpYLgRulA41Xl-sA,11313
|
|
61
64
|
jararaca/scheduler/types.py,sha256=4HEQOmVIDp-BYLSzqmqSFIio1bd51WFmgFPIzPpVu04,135
|
|
62
65
|
jararaca/tools/app_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
66
|
jararaca/tools/app_config/decorators.py,sha256=-ckkMZ1dswOmECdo1rFrZ15UAku--txaNXMp8fd1Ndk,941
|
|
64
|
-
jararaca/tools/app_config/interceptor.py,sha256=
|
|
65
|
-
jararaca/tools/metadata.py,sha256=7nlCDYgItNybentPSSCc2MLqN7IpBd0VyQzfjfQycVI,1402
|
|
67
|
+
jararaca/tools/app_config/interceptor.py,sha256=HV8h4AxqUc_ACs5do4BSVlyxlRXzx7HqJtoVO9tfRnQ,2611
|
|
66
68
|
jararaca/tools/typescript/interface_parser.py,sha256=35xbOrZDQDyTXdMrVZQ8nnFw79f28lJuLYNHAspIqi8,30492
|
|
67
69
|
jararaca/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
70
|
jararaca/utils/rabbitmq_utils.py,sha256=FPDP8ZVgvitZXV-oK73D7EIANsqUzXTW7HdpEKsIsyI,2811
|
|
69
|
-
jararaca-0.3.
|
|
70
|
-
jararaca-0.3.
|
|
71
|
-
jararaca-0.3.
|
|
72
|
-
jararaca-0.3.
|
|
73
|
-
jararaca-0.3.
|
|
71
|
+
jararaca-0.3.11a5.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
72
|
+
jararaca-0.3.11a5.dist-info/METADATA,sha256=ny8RCQjyQTsSqnFTtSnYPz2_SfQmvp0GijuxTSZUG6w,4997
|
|
73
|
+
jararaca-0.3.11a5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
74
|
+
jararaca-0.3.11a5.dist-info/entry_points.txt,sha256=WIh3aIvz8LwUJZIDfs4EeH3VoFyCGEk7cWJurW38q0I,45
|
|
75
|
+
jararaca-0.3.11a5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|