I was pleasantly surprised to see this, but it seems that the JS context in each run of the cron script is cloned so cron jobs are actually run in a separate "process". Namely, I ran this example. let s = 0, r = 0; Deno.cron("Add second", "* * * * *", async () => { console.log(`Add second ${s++}`); }); Deno.serve(async (_req) => { return new Response(`Seconds Running: ${s} / Number of requests: ${r++}`); }) Example d…
Deno Cron
111–120 of 190 posts
Re: Deno Cron
#112Re: Deno Cron
#113Re: Deno Cron
#114I like a lot of what Deno does, but I'm having some trouble understanding why this (along with Deno's KV and Queues offering) is part of the Deno runtime. The blog post touts this as a feature to reduce the amount of code to get up and running, but a library would accomplish the same thing. A first-party library could even directly integrate with Deno Deploy in the same way that this appears to. Why pollute the runti…
Because money.
They are venture funded and need to show some kind of path to profitability.
Re: Deno Cron
#115The AI-generated imagery at https://deno.com/blog/cron/cover.png is actually painful the longer you look at it. The multiple watch hands might be an artistic effect, but the clock lacks the tenth hour and has two elevenths, the dinosaur's legs make absolutely no sense, and the water reflections show a different pattern on the dinosaur legs and a completely different set of clock hands than what is visible above. I kn…
Re: Deno Cron
#116Earlier quoted context omitted.
This is pretty much what Inngest is ( https://www.inngest.com/ ). Runs on Deno as well.
Ingest is definitely nice. Its design is an orchestrator/scheduler where you offload your workers as serverless functions. The only issue is for background jobs you need to design it in such way to not run in to timeouts. Which makes it slightly more complex then just having a single executable running periodically. There is also https://www.defer.run/ which run your code on their infra and don't have timeouts. But t…
Currently, to get beyond the ~5 min limit per step, you'd need to deploy to something non-serverless like Fly.io, Render, or your own instance running Express.js or similar.
Re: Deno Cron
#117But why not include any kind of schedule specifier that is a bit less cryptic and error prone? Is it really so much code?
Maybe someone has a package already that can wrap this or output a schedule from a human readable description or something. Maybe something like `human-to-cron`.
Re: Deno Cron
#118I can see from comments like vvpan's that there is a fatigue around managing services in AWS/GCP/etc, but I have gone very much in the other direction in the last few years towards bare metal servers managed with NixOS. I feel much more confident in handling scheduled jobs on bare metal with Systemd timers than tying myself even deeper into a specific language+deployment solution ecosystem.
Re: Deno Cron
#119I am a lead on a small startup team and one of the biggest pain points is dealing with infrastructure. We have no dedicated devops person and much of that work falls on me and other people who would be better writing code. I think the cloud paradigm is experiencing a shift. Few of us want to deal with cloud infrastructure (whether clicking around or via Terraform or equivalent) to execute a function every X minutes -…
It is really disappointing to me when I hear takes like this. As an industry we are splitting the roles of programmers and engineers so that programmers can just throw spaghetti at the wall and it is the engineers problem to happily run it. We need more well rounded people that also fundamentally understand how their code is executing on the backend so performance and cost can be optimized.
Re: Deno Cron
#120Great, but do they really have to leave the cron schedule format as the only option for specifying? It seems like a great idea if it's 1975 and you are dealing with limitations of that time. And I think it's good to keep it as an option. But why not include any kind of schedule specifier that is a bit less cryptic and error prone? Is it really so much code? Maybe someone has a package already that can wrap this or ou…