Forums

Discuss all things Remember The Milk.

menu

MilkScript - sleep function

noritake says:
How can I write 'sleep' function in MilkScript?

I tried 'setTimeout' function, but 'ReferenceError' occurerd.
Posted at 9:26am on November 10, 2022
jonathan.pilborough says:
Why would you want to do that?

Bear in mind that a MilkScript runs on the RTM server, not in your web browser.

This means that:
- You cannot use functions that are part of the browser javascript API.
- A sleep 'wastes' the time of the RTM server
- All MilkScripts have to complete within 10 seconds.
- There is no gurantee you will see the effect of the MilkScript instantly.
Posted 1 year ago
noritake says:
Thank you.
I understand the points to note about MilkScript.

I write the external API fetch handling in MilkScript. According to the specifications of the external API, if the value of response data.continue is 1, it will be retried after an interval of about 2 seconds. I want to implement this retry handling.
Posted 1 year ago
This topic has now been closed automatically due to a lack of responses in the past 90 days.