aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/reactor.py
Commit message (Collapse)AuthorAgeFilesLines
* reactor: support for delayed callbacksJanar Sööt2019-01-071-5/+5
| | | | Signed-off-by: Janar Sööt <janar.soot@gmail.com>
* reactor: Add ability to register callbacksKevin O'Connor2018-06-301-6/+58
| | | | | | | Add the ability to register callbacks - both asynchronous (ie, from another thread) and synchronous. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* reactor: Fix bug causing end() to not always workKevin O'Connor2017-04-131-4/+2
| | | | | | Only set the self._process flag in run() not _dispatch_loop(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* reactor: Support pause() command even when the reactor is not runningKevin O'Connor2017-04-011-1/+9
| | | | | | | If the reactor isn't running then implement pause using the system sleep command. This simplifies the users of pause(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* reactor: Use the system monotonic clock instead of the normal system clockKevin O'Connor2017-02-061-11/+13
| | | | | | | | | | | | | The normal system clock can have sudden jumps if the system clock is changed. Use the system monotonic clock to avoid these sudden changes in time. It appears the Raspbian OS (which is used by OctoPi) is setup to update the system clock upon network connectivity. This could cause sudden system clock changes which could lead to Klippy processing errors. Using the monotonic clock eliminates these issues. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* reactor: Reload eventtime if a greenlet is reactivatedKevin O'Connor2017-01-101-2/+5
| | | | | | | | Fix a bug causing timers to be delayed when pause() is called from a fd event. The eventtime needs to be reloaded when an old greenlet is reactivated. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* reactor: Add support for greenletsKevin O'Connor2016-11-291-5/+53
| | | | | | | Add support for greenlets - a mechanism for tasks that can pause while still allowing regular reactor events to occur. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+142
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>