Asyncio (or something better) for control of a vacuum system/components.

Marko Rauhamaa marko at pacujo.net
Mon Mar 24 06:22:05 EDT 2014


Shishir <shishirk at gmail.com>:

> The problem is that self.execute() blocks and the asyncio framework
> has no way to know how to reschedule it or bypass it. This can be
> avoided if I depended on I/O from a file descriptor, on which I can
> apply poll()/select(). But the channel handler that I have is more
> generic (rs232() in code above).

Deep down asyncio depends on file descriptors. If your thingy is another
kind of object, it needs to go into its own process or thread.

> A server sits on the computer which is connected to the devices via
> channels (rs232, rs485, usb etc.). [...]

Sounds about right.

> I have looked around the web but couldn't find an easy+flexible
> framework to do what I have outlined here.

Asyncio + subprocess should be all you need for a framework. However, some
system programming *will* be required.


Marko



More information about the Python-list mailing list