Changelog
February 25th, 2023

What's new:
Retries and Concurrency

Charly PolyCharly PolyCEO

Configurable retries and concurrency have always been part of our roadmap.

Many of you expressed the need to have it as soon as possible, so we delivered!

By updating to @defer/client@1.0.0, you can now configure retry and concurrency using defer().

Retry

By default, Defer Platform won't retry any failed execution.

However, you might want to enable retries for background functions that, for example, interact with rate-limited 3rd party APIs.


Enabling retries on a background function is straightforward:

import { defer } from "@defer/client"
async function importContacts(accountId: string) {	// ...}
export default defer(importContacts, {	retry: 2,}
💡  Retries maximum

retry can be configured to 12 maximum, which gives a maximum retry at 12 hours after the first failed execution.

Concurrency

By default, Defer Platform will execute background functions using your account limits (Free: 2, Pro: 10 to custom).


By having a Pro plan, you'll be able to configure the concurrency of your background functions up to 10.

Here is an importContacts() background function that will be executed in parallel (up to 10):

import { defer } from "@defer/client"
async function importContacts(accountId: string) {  // ...}
export default defer(importContacts, {  concurrency: 10,}

Please note that concurrency above 2 is only available on the Pro and Custom plans.

💡  Concurrency per account

Each account gets a maximum concurrency (Hobby: 2, Pro: 10) that take precedence on the configured background functions concurrency.

For example, on a Pro Plan, if 2 background functions with concurrency: 10 trigger 100 executions each, the Defer Platform will take 5 of each concurrently, matching the account's maximum concurrency (10).

We hope that the retry and concurrency features will empower you to build more advanced background functions and a quick user experience.

We would love to get your feedback in the comment section below!


Stay tuned for the upcoming releases - spoiler: a brand new Dashboard Functions view.

Join the community and learn how to get started, and provide feedback.
Stay tuned about our latest product and company updates.
Start creating background jobs in minutes.
Copyright ©2023 Defer Inc.