Skip to content

file_system_output_device

messageflux.iodevices.file_system.file_system_output_device

FileSystemOutputDevice

FileSystemOutputDevice(
    manager,
    name,
    tmp_folder,
    queues_folder,
    format_filename=None,
    serializer=None,
)

Bases: OutputDevice['FileSystemOutputDeviceManager']

And OutputDevice that writes to filesystem

Parameters:

Name Type Description Default
manager FileSystemOutputDeviceManager

the output device manager that created this device

required
name str

the name of this device

required
tmp_folder str

the folder to create temporary files in

required
queues_folder str

the base folder for all queues

required
format_filename Optional[str]

the filename format to save the product, "{filename}-{item_id}"

None
serializer Optional[FileSystemSerializerBase]

the serializer to use

None

FileSystemOutputDeviceManager

FileSystemOutputDeviceManager(
    root_folder,
    queue_dir_name=FileSystemDeviceManagerBase.DEFAULT_QUEUES_SUB_DIR,
    tmp_dir_name=FileSystemDeviceManagerBase.DEFAULT_TMPDIR_SUB_DIR,
    bookkeeping_dir_name=FileSystemDeviceManagerBase.DEFAULT_BOOKKEEPING_SUB_DIR,
    serializer=None,
    output_filename_format=None,
    **kwargs
)

Bases: FileSystemDeviceManagerBase, OutputDeviceManager[FileSystemOutputDevice]

this is a device manager that generates output filesystem devices

Parameters:

Name Type Description Default
root_folder str

the root folder to use for the manager

required
queue_dir_name str

the name of the subdirectory under root_folder that holds the queues

DEFAULT_QUEUES_SUB_DIR
tmp_dir_name str

the name of the subdirectory under root_folder to use for temp files

DEFAULT_TMPDIR_SUB_DIR
bookkeeping_dir_name str

the name of the subdirectory under root_folder that holds the book-keeping data

DEFAULT_BOOKKEEPING_SUB_DIR
serializer Optional[FileSystemSerializerBase]

the serializer to use to write messages to files. None will use the default serializer

None
output_filename_format Optional[str]

the filename format to save a product, "{filename}-{item_id}"

None

connect

connect()

connects to the device manager