@nextastic/queue
Advanced tools
Comparing version 0.3.0 to 0.3.1
export * from './create-job'; | ||
export * from './debounced-dispatch'; | ||
export * from './get-queue'; | ||
@@ -4,0 +3,0 @@ export * from './schedule-jobs'; |
@@ -18,3 +18,2 @@ "use strict"; | ||
__exportStar(require("./create-job"), exports); | ||
__exportStar(require("./debounced-dispatch"), exports); | ||
__exportStar(require("./get-queue"), exports); | ||
@@ -21,0 +20,0 @@ __exportStar(require("./schedule-jobs"), exports); |
import { Queue } from './types'; | ||
export declare function scheduleJobs(queues: Queue[], schedule: () => void): Promise<void>; | ||
interface ScheduleJobsParams { | ||
queues: Queue[]; | ||
schedule: () => void; | ||
} | ||
export declare function scheduleJobs(params: ScheduleJobsParams): Promise<void>; | ||
export {}; |
@@ -5,3 +5,4 @@ "use strict"; | ||
const get_queue_1 = require("./get-queue"); | ||
async function scheduleJobs(queues, schedule) { | ||
async function scheduleJobs(params) { | ||
const { queues, schedule } = params; | ||
for (const queue of queues) { | ||
@@ -8,0 +9,0 @@ const queueInstance = (0, get_queue_1.getQueue)(queue.name); |
import { Queue } from './types'; | ||
interface WorkConfig { | ||
interface WorkParams { | ||
queues: Queue[]; | ||
jobsDir?: string; | ||
} | ||
export declare function work(queues: Queue[], config?: WorkConfig): Promise<void>; | ||
export declare function work(params: WorkParams): Promise<void>; | ||
export {}; |
@@ -11,4 +11,5 @@ "use strict"; | ||
const get_jobs_1 = require("./get-jobs"); | ||
async function work(queues, config = {}) { | ||
const jobs = await (0, get_jobs_1.getJobs)(config.jobsDir); | ||
async function work(params) { | ||
const { queues, jobsDir } = params; | ||
const jobs = await (0, get_jobs_1.getJobs)(jobsDir); | ||
for (const queue of queues) { | ||
@@ -15,0 +16,0 @@ const connection = new ioredis_1.default(process.env.REDIS_HOST, { |
{ | ||
"name": "@nextastic/queue", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Queue provides an API to run background jobs for your application.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
25820
556