Message Producer¶
Message producer for non-HTTP interactions.
This modules implements a very basic message producer which could send to an eventing system, such as Kafka, or a message queue.
Classes¶
FileSystemAction
¶
FileSystemEvent
¶
Bases: NamedTuple
Represents a file system event.
FileSystemMessageProducer()
¶
A message producer for file system events.
Source code in examples/src/message_producer.py
Attributes¶
queue = MockMessageQueue()
instance-attribute
¶
Functions¶
send_read_event(filename: str) -> None
¶
Send a read event to a message queue.
:param filename: The name of the file.
Source code in examples/src/message_producer.py
send_to_queue(message: FileSystemEvent) -> None
¶
Send a message to a message queue.
:param message: The message to send.
Source code in examples/src/message_producer.py
send_write_event(filename: str, contents: str) -> None
¶
Send a write event to a message queue.
PARAMETER | DESCRIPTION |
---|---|
filename |
The name of the file.
TYPE:
|
contents |
The contents of the file.
TYPE:
|