Will cron jobs be supported on ICP?
I’m also interested in this topic.
It is possible to implement.
+1 on this. Some financial applications:
- liquidate overleveraged positions - Maker had issues earlier this year because their keeper bots were not liquidating in a timely manner
- interest rate calculations - lending protocols only update their rates on every user action, when ideally this should happen continuously
- harvesting - collect farming rewards continuously for true compounding
Yes, me too. 20 chars
+1
Saying something to get to 20 characters.
Did you ever find out if they have?
Embarrassing that the Dfinity team doesnt one someone monitoring these forums to answer questions
These forums are monitored 24 hours a day. We give explicit timelines for many, but not every, feature request. We are aware of a need for this and have discussed it internally. I apologize as I am sure that is not the answer you wanted to hear. There is still many system critical, performance critical, or just low-hanging fruit that gets higher priority for triage. I will see what I can do about making the triaging process more transparent.
Thanks for finally answering after 3 months. So are you confirming that there is currently no functionality within DFINITY to have any sort of scheduled tasks?
No, not currently exposed to the end user. I suspect the subnet management canister aaaaa-aa
will provide API for this in the future, but, as I stated previously, I cannot give an explicit timeline for this. I can say that our code base will be made public with a month, so very soon any developer can submit a PR.
There’s also a new team being set up that’ll be dedicated to developer support within the forum and wider community for you, the developer community will be getting more and more focus going forward, see Stanley’s recent opening post for news on this: https://forum.dfinity.org/t/developer-experience-january-2021/1749?u=ori
So in other word DFINITY is currently not suitable for any development apart from simple web pages without server logic which is a shame. Are you actually hoping that external developers will implement the basic features in your platform for free?
I’m not suggesting that at all. Many use cases for traditional cloud computing services are also applicable to the IC. I would estimate that online gaming has seen more enthusiasm among developers here recently, but there has been more media attention around open-internet services like LinkedUp and CanCan . I find this Reversi game to be particularity inspiring. The IC is very flexible, and in many cases, the limits are your imagination. Checkout some projects from the Tungsten Demo Day to get inspired.
We have an ecosystem fund to financially support external developers who contribute to the IC.
https://dfinity.org/ecosystem/fund/
Great with the fund but my interest is in developing a simple server feature ticking periodically
I would not say the limitation is the imagination though rather than missing basic features like scheduled tasks or timers which I struggle to see any real projects being able to live without this basic elementary function. Or do you see any way to solve this?
I absolutely agree that this is a basic feature. I’ll see what engineering resources we can spare to prioritize this. I submitted at ticket to dfx-triage, so the issue is being tracked.
Awesome. Thanks. Lets spear some developers to get this done
Some people have had success by having their canister send messages to themselves indefinitely, i.e. some kind of busy loop, and then spawn their actions from that.
That works. I consider it a hack (and it has its pitfalls), but it seems to work well enough to work around the lack of a more principled cron-like functionality (which I assume to be inevitable in the long run).
Not sure if this is an example of what you’re talking about: GitHub - matthewhammer/motoko-bigtest: Long-running tests for services on the Internet Computer that also run there but I found this interesting
Anything new regarding this topic?
I’d be interested to use cron jobs for my app, ideally in Motoko. Not sure how I could achieve it otherwise.
Haha, we have in fact had progress on this since January of 2021.
The current status is there are two ways to schedule an automatic canister execution on ICP:
- Timers: single-expiration or periodic canister calls with specified minimum timeout or interval.
- Heartbeats: legacy periodic canister invocations with intervals close to the blockchain finalization rate (1s). Heartbeats are supported by ICP for backward compatibility and some very special use cases. Newly developed canisters should prefer using timers over the heartbeats.
Heartbeats were unnecessarily expensive, so check out the timer docs!
Awesome, thanks a lot!