Skip to content

workerJS/workerjs-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workerjs-redis

Abstraction layer for using queue and messaging as event listeners.

Messaging

Receive

const messaging = require("workerjs-redis")().messaging;

messaging.on("test", function(data){
	console.log(data);
}).then(function(){
	console.log("Subscribed");
}).catch(function(){
	console.log("Error while subscribing");
});

Send

const messaging = require("workerjs-redis")().messaging;

messaging.emit("test", 123).then(function(){
	console.log("Sent");
}).catch(function(){
	console.log("Error while sending");
});

Queue

Receive

var queue = require("workerjs-redis")().queue;

queue.on("tasks", function(data){
	console.log(data);
});

Send

var queue = require("workerjs-redis")().queue;

queue.emit("tasks", "123").then(function(){
	console.log("Sent");
}).catch(function(){
	console.log("Error while sending");
});

About

Redis wrapper for WorkerJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published