Skip to content

transformer_output_device

messageflux.iodevices.transformer_device_wrapper.transformer_output_device

OutputTransformerBase

transformer for output devices

connect

connect()

this method is called when the transformer device manager is connected

disconnect

disconnect()

this method is called when the transformer device manager is disconnected

transform_outgoing_message abstractmethod

transform_outgoing_message(output_device, message_bundle)

Transform the message before it is sent to the underlying device.

Parameters:

Name Type Description Default
output_device TransformerOutputDevice

the output device that the transformer runs on

required
message_bundle MessageBundle

the message bundle to transform

required

Returns:

Type Description
MessageBundle

the transformed message bundle to send through the underlying device

TransformerOutputDevice

TransformerOutputDevice(
    manager, name, inner_device, transformer
)

Bases: OutputDevice['TransformerOutputDeviceManager']

a wrapper device that transforms outgoing messages

Parameters:

Name Type Description Default
manager TransformerOutputDeviceManager

the device manager

required
name str

the name of the device

required
inner_device OutputDevice

the inner device that this device wraps

required
transformer OutputTransformerBase

the output transformer to use

required

close

close()

closes the inner device

TransformerOutputDeviceManager

TransformerOutputDeviceManager(
    inner_device_manager, transformer, **kwargs
)

Bases: OutputDeviceManager[TransformerOutputDevice]

a wrapper output device manager, that wraps the devices in transformer output devices

Parameters:

Name Type Description Default
inner_device_manager OutputDeviceManager

the inner device manager

required
transformer OutputTransformerBase

the transformer to use

required

connect

connect()

connects the inner device manager and the transformer

disconnect

disconnect()

disconnects the inner device manager and the transformer