Menu
Deno adds Deno Cron for job scheduling

Deno adds Deno Cron for job scheduling

Deno Cron jobs can perform actions such as updating state in Deno KV, pinging a website, sending email, initiating a database backup, and calling an API at regular intervals.

Credit: Dreamstime

Deno Land, the developers of the Deno TypeScript/JavaScript runtime, have introduced Deno Cron, a feature the company describes as an easy way to create scheduled jobs.

Announced November 29 and available behind the --unstable flag in Deno 1.38, Deno.cron() is a function that takes three parameters: the name of the scheduled job, the schedule, and the handler, the latter being the function executed on the schedule provided. Deno Cron’s schedule uses the Unix cron format and the UTC time zone. Deno Cron handlers can perform actions such as updating state in Deno KV, pinging a website, sending email, initiating a database backup, and calling an API at regular intervals.

Unlike cron jobs on Unix and Linux, Deno Cron executions do not overlap. Hence, if  an operator schedules a job to run every 10 minutes but the task takes 30 minutes, Deno Cron automatically skips the next scheduled run until the task is finished. Overlapping cron jobs can lead to unintended issues and require extra logic to avoid, Deno Land said; Deno Deno Cron sidesteps that. Deno Land also is working to support a JavaScript-friendly API to specify the cron schedule.

In explaining the rationale behind Deno Cron, Deno Land said building for the web has become increasingly complex. Modern software uses cloud infrastructure, dissects boilerplate code, and manages intricate configurations. But developers just want to focus on business logic. Deno Land strives to ease web development by removing config and unnecessary boilerplate. Like Deno KV and Deno Queues, which can be added to an application with only a few lines of code, Deno Cron is designed to make web development simpler, the company said.

On the Deno Deploy serverless JavaScript platform, Deno.cron() is automatically managed, allowing users to run cron jobs without a web server or even consistent requests to keep an isolate alive. Whenever a project is deployed, Deno Deploy automatically detects cron jobs and evaluates them. When it is time for a handler to run, Deno Deploy automatically spins an isolate on-demand to run it. A Cron tab has been added to the Deno Deploy dashboard to show active cron jobs in a project.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Events

EDGE 2024

Register your interest now for EDGE 2024!

Brand Post

Featured

Slideshows

How MSPs can capitalise on integrating AI into existing services

How MSPs can capitalise on integrating AI into existing services

​Given the pace of change, scale of digitalisation and evolution of generative AI, partners must get ahead of the trends to capture the best use of innovative AI solutions to develop new service opportunities. For MSPs, integrating AI capabilities into existing service portfolios can unlock enhancements in key areas including managed hosting, cloud computing and data centre management. This exclusive Reseller News roundtable in association with rhipe, a Crayon company and VMware, focused on how partners can integrate generative AI solutions into existing service offerings and unlocking new revenue streams.

How MSPs can capitalise on integrating AI into existing services
Access4 holds inaugural A/NZ Annual Conference

Access4 holds inaugural A/NZ Annual Conference

​Access4 held its inaugural Annual Conference in Port Douglass, Queensland, for Australia and New Zealand from 9-11 October, hosting partners from across the region with presentations on Access4 product updates, its 2023 Partner of the Year awards and more.

Access4 holds inaugural A/NZ Annual Conference
Show Comments