message_consumers
#
BaseMessageQueueConsumer #
Bases: BaseModel
, ABC
Consumer of a MessageQueue.
Process messages from a MessageQueue for a specific message type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_
|
str
|
|
'f420b530-fd8c-4360-8ce7-12687be50bee'
|
message_type
|
str
|
Type of the message to consume. |
'default'
|
channel
|
Any
|
The channel if any for which to receive messages. |
None
|
consuming_callable
|
Callable[..., Coroutine[Any, Any, None]]
|
|
<function default_start_consuming_callable at 0x7fa9c0c18ea0>
|
Source code in llama_deploy/message_consumers/base.py
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 |
|
process_message
async
#
process_message(message: QueueMessage, **kwargs: Any) -> Any
Logic for processing message.
Source code in llama_deploy/message_consumers/base.py
42 43 44 45 46 |
|
start_consuming
async
#
start_consuming() -> None
Begin consuming messages.
Source code in llama_deploy/message_consumers/base.py
48 49 50 51 52 |
|
CallableMessageConsumer #
Bases: BaseMessageQueueConsumer
Message consumer for a callable handler.
For a given message, it will call the handler with the message as input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handler
|
Callable
|
|
required |
Source code in llama_deploy/message_consumers/callable.py
8 9 10 11 12 13 14 15 16 17 18 19 20 |
|