Releases: defer-run/defer.client
v1.6.0
Minor Changes
-
#70
4646cd0
Thanks @gearnode! - IntroducingmaxDuration
supportdefer()
exposes a newmaxDuration
configuration:const importContacts = (companyId: string, contacts: Contact[]) => { // ... }; export default defer(importContacts, { maxDuration: 10 // timeout after 10secs });
BREAKING CHANGE:
maxDuration
has a default value to 30min. Users having executions going over this limit can override it with a higher value{ maxDuration: 3600 }
-
#70
c92bb44
Thanks @gearnode! - Allow options for CRON function
Patch Changes
v1.5.0
v1.4.0
v1.3.1
v1.3.0
v1.2.0
v1.1.0
Minor Changes
-
#36
ccc39dd
Thanks @charlypoly! - exposegetExecution(id)
to poll for an execution status and result:import { type FetchExecutionResponse, getExecution } from "@defer/client"; import type { NextApiRequest, NextApiResponse } from "next"; type Response = { res: FetchExecutionResponse; }; export default async function handler( req: NextApiRequest, res: NextApiResponse<Response> ) { const executionId = req.query.id; const ret = await getExecution(executionId as string); res.status(200).json({ res: ret }); }
v1.0.0
Major Changes
-
#29
859bf46
Thanks @gearnode! - Add concurrency limit option.import { defer } from "@defer/client"; async function oneByOne() { // do something... } export default defer(oneByOne, { concurrency: 1 });
-
#31
d791d79
Thanks @gearnode! - Remove deprecated.delayed
API. -
#31
ef80061
Thanks @gearnode! -init
function renamed inconfigure
-
#31
ef80061
Thanks @gearnode! - Handle API HTTP error by throwing an error -
#31
ef80061
Thanks @gearnode! - Keep same behavior in dev and prod -
#34
fe251f2
Thanks @charlypoly! - BREAKING CHANGE:- Renamed
defer.schedule()
todefer.cron()
defer.cron()
no longer takes a english string but a CRON tab string
import { defer } from "@defer.run/client"; const weeklyBrief = async () => { // ... }; export default defer.cron(weeklyBrief, "5 0 * * *");
- Renamed
Minor Changes
-
#34
e399d75
Thanks @charlypoly! - Deprecatedefer.await()
in favor ofawaitResult(deferFn)
import { importContacts } from "../defer/importContacts"; const importContactWithResult = awaitResult(importContacts); const result = await importContactWithResult("1", []);
v0.5.0
v0.4.0
Minor Changes
-
#24
ca35544
Thanks @charlypoly! - Introduce a new API to delay an execution:import { delay } from "@defer.run/client"; import { helloWorld } from "../defer/helloWorld"; // create a delayed execution const delayedHelloWorld = delay(helloWorld, "1h"); delayedHelloWorld(); // background execution in 1 hour