simple#
SimpleMessageQueue #
Bases: AbstractMessageQueue
Remote client to be used with a SimpleMessageQueue server.
Source code in llama_deploy/message_queues/simple/client.py
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 86 87 88 |
|
register_consumer
async
#
register_consumer(consumer: BaseMessageQueueConsumer, topic: str) -> StartConsumingCallable
Register a new consumer.
Source code in llama_deploy/message_queues/simple/client.py
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 |
|
SimpleMessageQueueConfig #
Bases: BaseSettings
Simple message queue configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type
|
Literal[str]
|
|
'simple'
|
host
|
str
|
|
'127.0.0.1'
|
port
|
int
|
|
8001
|
raise_exceptions
|
bool
|
|
False
|
use_ssl
|
bool
|
|
False
|
Source code in llama_deploy/message_queues/simple/config.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
SimpleMessageQueueServer #
SimpleMessageQueueServer.
An in-memory message queue that implements a push model for consumers.
When registering, a specific queue for a consumer is created. When a message is published, it is added to the queue for the given message type.
When launched as a server, exposes the following endpoints:
- GET /
: Home endpoint
- POST /register_consumer
: Register a consumer
- POST /deregister_consumer
: Deregister a consumer
- GET /get_consumers/{message_type}
: Get consumers for a message type
- POST /publish
: Publish a message
Source code in llama_deploy/message_queues/simple/server.py
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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
launch_server
async
#
launch_server() -> None
Launch the message queue as a FastAPI server.
Source code in llama_deploy/message_queues/simple/server.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|