-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy path__init__.py
More file actions
85 lines (70 loc) · 2.56 KB
/
__init__.py
File metadata and controls
85 lines (70 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
"""Event handling components for the A2A server."""
import logging
from a2a.server.events.event_consumer import EventConsumer
from a2a.server.events.event_queue import Event, EventQueue
from a2a.server.events.in_memory_queue_manager import InMemoryQueueManager
from a2a.server.events.queue_manager import (
NoTaskQueue,
QueueManager,
TaskQueueExists,
)
logger = logging.getLogger(__name__)
try:
from a2a.server.events.distributed_event_queue import (
DistributedEventQueue, # type: ignore
)
from a2a.server.events.queue_lifecycle_manager import (
QueueLifecycleManager, # type: ignore
QueueProvisionResult, # type: ignore
)
from a2a.server.events.sns_queue_manager import (
SnsQueueManager, # type: ignore
)
except ImportError as e:
_original_aws_error = e
logger.debug(
'AWS distributed event components not loaded. '
'Install the aws extra to enable them. Error: %s',
e,
)
class DistributedEventQueue: # type: ignore
"""Placeholder when aws extra is not installed."""
def __init__(self, *args, **kwargs):
raise ImportError(
'To use DistributedEventQueue, install the aws extra: '
'\'pip install "a2a-sdk[aws]"\''
) from _original_aws_error
class SnsQueueManager: # type: ignore
"""Placeholder when aws extra is not installed."""
def __init__(self, *args, **kwargs):
raise ImportError(
'To use SnsQueueManager, install the aws extra: '
'\'pip install "a2a-sdk[aws]"\''
) from _original_aws_error
class QueueLifecycleManager: # type: ignore
"""Placeholder when aws extra is not installed."""
def __init__(self, *args, **kwargs):
raise ImportError(
'To use QueueLifecycleManager, install the aws extra: '
'\'pip install "a2a-sdk[aws]"\''
) from _original_aws_error
class QueueProvisionResult: # type: ignore
"""Placeholder when aws extra is not installed."""
def __init__(self, *args, **kwargs):
raise ImportError(
'To use QueueProvisionResult, install the aws extra: '
'\'pip install "a2a-sdk[aws]"\''
) from _original_aws_error
__all__ = [
'DistributedEventQueue',
'Event',
'EventConsumer',
'EventQueue',
'InMemoryQueueManager',
'NoTaskQueue',
'QueueLifecycleManager',
'QueueManager',
'QueueProvisionResult',
'SnsQueueManager',
'TaskQueueExists',
]