From 53ef1c63eaaebcf3fb09037f0990cf5e0c7ba5d9 Mon Sep 17 00:00:00 2001 From: Lonami Date: Wed, 31 Jul 2019 13:51:47 +0200 Subject: [PATCH] Updated Scheduling Functions (markdown) --- Scheduling-Functions.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scheduling-Functions.md b/Scheduling-Functions.md index f546dde..97475cb 100644 --- a/Scheduling-Functions.md +++ b/Scheduling-Functions.md @@ -28,6 +28,9 @@ foo_cb() ``` This schedules itself again when it runs, so it is always running. It runs, 10 minutes pass, it schedules itself again, and repeat. This is similar to JavaScript's [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout). + +> **Important note**. Do **not** call the synchronous function when you schedule it, or it will recurse forever. `loop.call_later(delay, func())` won't work, but `loop.call_later(delay, func)` will. + You can also use `while` loops: ```python