Skip to content

⚙️ Flexible, high-preformance job queue built at Prodia.

Notifications You must be signed in to change notification settings

prodialabs/multiqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiqueue logo

Flexible, high-preformance job queue built at Prodia.

features

  • Zero-dependencies outside core Redis types
  • First-class TypeScript support with generics
  • Auto-retry functionality with timeout
  • Automatic test suite

example usage

The following code imagines you have two queue pipelines: one for resizing images and one for resizing videos.

type Queue = "resize-image" | "resize-video";

type Job = {
	id: number;
	path: string;
	resizeWidth: number;
};

const mq = createMultiQueue<Queue, Job>({
	redis,
	prefix: "multiqueue",
	retryAfter: 60 * 1000, // retry if not completed within 1 minute
});

await mq.push("resize-image", {
	id: 1,
	path: "my-image.jpg",
	resizeWidth: 1024,
});

const imageToResize: Job = await mq.pop("resize-image");

// do resizing work

await mq.complete(imageToResize);

About

⚙️ Flexible, high-preformance job queue built at Prodia.

Topics

Resources

Stars

Watchers

Forks