Skip to content

output_devices

messageflux.iodevices.base.output_devices

OutputDevice

OutputDevice(manager, name)

Bases: Generic[TManagerType]

base class for all output devices

Parameters:

Name Type Description Default
manager TManagerType

the output device manager that created this device

required
name str

the name of this device

required

manager property

manager

Returns:

Type Description

the input device manager that created this device

name property

name

Returns:

Type Description

the name of this device

close

close()

and optional method that cleans device resources if necessary

send_message

send_message(message, device_headers=None)

sends a message to the device.

Parameters:

Name Type Description Default
message Message

the message to send

required
device_headers Optional[DeviceHeaders]

optional headers to send to underlying device. those headers are not part of the message, but contains extra data for the device, that can modify its operation

None

OutputDeviceException

OutputDeviceException(
    *args, inner_exceptions=None, **kwargs
)

Bases: AggregatedException

a base exception class for all output device related exceptions

OutputDeviceManager

OutputDeviceManager(**kwargs)

Bases: Generic[TOutputDeviceType]

this is a base class for output device managers. it is used to create output devices

connect

connect()

connects to the device manager

delete_output_device_from_cache

delete_output_device_from_cache(name)

deletes a cached output device from cache.

Parameters:

Name Type Description Default
name str

the device to delete from cache

required

Returns:

Type Description
bool

True if the device existed and deleted, False otherwise

disconnect

disconnect()

disconnects from the device manager

get_output_device

get_output_device(name)

creates an output device. this should be implemented by child classes

Parameters:

Name Type Description Default
name str

the name of the output device to create

required

Returns:

Type Description
TOutputDeviceType

the created output device