@defer/client
Advanced tools
Comparing version 1.16.0-alpha-20240115132828-ce26aa5 to 1.16.0-alpha-20240115133837-7fc17a6
@@ -5,3 +5,3 @@ "use strict"; | ||
const errors_js_1 = require("./errors.js"); | ||
const index_1 = require("./index"); | ||
const index_js_1 = require("./index.js"); | ||
const queue_js_1 = require("./queue.js"); | ||
@@ -29,3 +29,3 @@ const fns = {}; | ||
async function invoke(invocation, throwErrors = false) { | ||
index_1.__database.set(invocation.id, { id: invocation.id, state: "started" }); | ||
index_js_1.__database.set(invocation.id, { id: invocation.id, state: "started" }); | ||
let state = "succeed"; | ||
@@ -61,3 +61,3 @@ let originalResult; | ||
const response = { id: invocation.id, state, result }; | ||
index_1.__database.set(invocation.id, response); | ||
index_js_1.__database.set(invocation.id, response); | ||
// make sure to release the lock even in case of error | ||
@@ -64,0 +64,0 @@ invocation.oncomplete?.(response); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "1.16.0-alpha-20240115132828-ce26aa5"; | ||
exports.default = "1.16.0-alpha-20240115133837-7fc17a6"; |
import { DeferError } from "./errors.js"; | ||
import { __database, } from "./index"; | ||
import { __database, } from "./index.js"; | ||
import { Queue } from "./queue.js"; | ||
@@ -4,0 +4,0 @@ const fns = {}; |
@@ -1,1 +0,1 @@ | ||
export default "1.16.0-alpha-20240115132828-ce26aa5"; | ||
export default "1.16.0-alpha-20240115133837-7fc17a6"; |
{ | ||
"name": "@defer/client", | ||
"version": "1.16.0-alpha-20240115132828-ce26aa5", | ||
"version": "1.16.0-alpha-20240115133837-7fc17a6", | ||
"description": "Zero infrastructure NodeJS background jobs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
import { FetchExecutionResponse } from "./client.js"; | ||
import { DeferredFunction, DeferableFunction } from "./index"; | ||
import { DeferredFunction, DeferableFunction } from "./index.js"; | ||
export declare function registerFunction<F extends DeferableFunction>(wrapped: DeferredFunction<F>): void; | ||
export declare function execLocally<F extends DeferableFunction>(id: string, func: DeferredFunction<F>, args: any, throwErrors?: boolean): Promise<FetchExecutionResponse<any>>; |
@@ -1,2 +0,2 @@ | ||
import { Concurrency } from "."; | ||
import { Concurrency } from "./index.js"; | ||
export declare class Queue<T> extends Array<T> { | ||
@@ -3,0 +3,0 @@ invoker: (item: T) => Promise<void>; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.16.0-alpha-20240115132828-ce26aa5"; | ||
declare const _default: "1.16.0-alpha-20240115133837-7fc17a6"; | ||
export default _default; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76110