autopilot icon indicating copy to clipboard operation
autopilot copied to clipboard

Stream method for hardware objects

Open sneakers-the-rat opened this issue 4 years ago • 1 comments

From the discussion board (https://groups.google.com/g/autopilot-users/c/6jdWZv05bfI/m/1F438EqxCQAJ)

All hardware objects should be able to easily stream events.

The API that makes sense to me is something like this

from autopilot.hardware.gpio import Digital_In
pin = Digital_In(1)
pin.stream(pin.level, **stream_kwargs)
# or
pin.stream('level', **stream_kwargs)

In the interest of making this general, one strategy might be to make a decorator that wraps attributes of the object such that when they are updated a message is emitted to the configured streaming target.

sneakers-the-rat avatar Nov 21 '20 00:11 sneakers-the-rat

punting this to 0.5.0 so we can work networking and method categories into a unified inheritance structure

sneakers-the-rat avatar Jul 22 '21 05:07 sneakers-the-rat