LocalFileChangeStream is a source primitive that can be used to listen to file change events for a file path. To create a LocalFileChangeStream provide the
|file_path||file path to listen to changes in|
|event_types||List of event types to subscribe to. Defaults to: |
from buildflow.io.local import LocalFileChangeStream from buildflow.types.local import FileChangeStreamEventType, LocalFileChangeEvent source = LocalFileChangeStream(file_path="./dir_to_listen/", event_types=[FileChangeStreamEventType.CREATED]) @app.consumer(source=source, sink=...) def process(elem: LocalFileChangeEvent): ...
The LocalFileChangeStream source always returns a
LocalFileChangeEvent object. This object contains the following fields:
|metadata||Any metadata that was associated with the file change event. This is a dictionary of strings.|
|blob||The raw contents of the file. This is lazily fetched.|