Skip to content

Releases: defer-run/defer.client

v1.6.0

03 Jul 09:37
de597e5
Compare
Choose a tag to compare

Minor Changes

  • #70 4646cd0 Thanks @gearnode! - Introducing maxDuration support

    defer() exposes a new maxDuration 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

22 Jun 12:27
7bc708f
Compare
Choose a tag to compare

Minor Changes

v1.4.0

02 Jun 16:01
8b20026
Compare
Choose a tag to compare

Minor Changes

v1.3.1

03 May 08:01
01b0eab
Compare
Choose a tag to compare

Patch Changes

v1.3.0

17 Apr 20:12
d94545c
Compare
Choose a tag to compare

Minor Changes

v1.2.0

24 Mar 18:39
101fa34
Compare
Choose a tag to compare

Minor Changes

Patch Changes

v1.1.0

05 Mar 06:11
5fd6423
Compare
Choose a tag to compare

Minor Changes

  • #36 ccc39dd Thanks @charlypoly! - expose getExecution(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

26 Feb 00:20
e305c8e
Compare
Choose a tag to compare

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 in configure

  • #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() to defer.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 * * *");

Minor Changes

  • #34 e399d75 Thanks @charlypoly! - Deprecate defer.await() in favor of awaitResult(deferFn)

    import { importContacts } from "../defer/importContacts";
    
    const importContactWithResult = awaitResult(importContacts);
    const result = await importContactWithResult("1", []);

v0.5.0

13 Feb 17:17
ec0acdc
Compare
Choose a tag to compare

Minor Changes

  • #26 4d2c4d4 Thanks @gearnode! - Add a primary retry option when defining defer function.

    import { defer } from "@defer.run/client";
    
    async function makeAPICallWhoMaybeFail() {
      // do something...
    }
    
    export default defer(makeAPICallWhoMaybeFail, { retry: 5 });

v0.4.0

02 Feb 16:10
52d0255
Compare
Choose a tag to compare

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