Open pepijndevos opened 9 years ago
Well, an event based system is possible, however, the low level ev3dev system has no such capability as far as I know. Please check https://github.com/ev3dev/ev3dev/issues/104 . So that means either pull by the framework or application. To avoid the unnecessary overhead, I decided to let application to poll the status. After ev3dev system support event, python-ev3 can easy support too. However, I will keep this thread open until we get a work event system.
The kernel interface is very much asynchronous. You write a value, and stuff happens. Currently, when you want to wait for a sensor or motor, you have to poll it.
I'm currently using this snippet in my code, but maybe we should think about a proper API, possibly using asyncio, Twisted, Gevent, or something else.