![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
feel free to contribute / open issues / create pull requests / fork, however use in production is highly discouraged
hique is a redis-backed job queue for NodeJS.
hique is heavily inspired by kue and bee-queue, and after using both frameworks pretty extensively I found that, though very well written, these frameworks do not fulfill two of my most desired aspects in:
hique was designed with these in mind.
hique differs from most frameworks by sacrificing a bit of performance to gain a much more stable environment, even when scaled up on different machines.
To scale hique to available cpus / machines, simply create a NodeJS process with a hique worker pointing to the same redis as every other worker and voila! scaling done easy.
npm install hique
npm install git+https://github.com/patriceperez/hique.git
Here is a simple example on how to set up a basic worker and a few jobs for testing
var hq = require('hique');
var worker = hq.Worker();
// tell the worker how to handle a job from type 'testJob'
worker.process('testJob', 5, function (job, done) {
console.log('executed job %s with data %s', job.id, JSON.stringify(job.data));
job.reportProgress(1, 1);
done(null, job.data.test); // complete job and save it's result
});
// inject 13 jobs from type 'testJob' to the worker to handle
for (var i = 0; i < 13; i++) {
worker.createJob('testJob', {test: i}).save(function (err, job) {
console.log('save new job %s and data %s', job.id, JSON.stringify(job.data));
});
}
check out the examples folder for more use cases
var worker = new Worker({
redis: {
host: 'localhost',
port: 6379,
db: 0,
options: {
family: 4,
keyPrefix: 'hq'
}
},
refreshRate: 1000
});
Field | Description |
---|---|
redis | same as the ioredis config object |
refreshRate | time in milliseconds to check for work in redis |
The values represented here are the defaults when no options are provided to the worker constructor.
In order to override any of the fields, simply provide them with the required value to the constructor, as follows
var worker = new Worker({
redis:{
db: 1
}
);
var redisInstance = require('ioredis');
var Worker = new Worker({}, redisInstance);
Process a new job type
worker.process(type, concurrency, function(job, done){
// job logic
done();
});
param | Description |
---|---|
type | string literal represnting the job type |
concurrenct (optional) | integer representing the amount of concurrent jobs the worker can handle simultaneously |
Create a new job
worker.createJob(type, data);
In order to save the new job object to redis so it can start work simplty add the save
function as follows
worker.createJob(type, data).save(function(err, job){
// error handling and the created job object
});
param | Description |
---|---|
type | string literal represnting the job type |
data | JSON object providing data to the job execution function |
Pause the worker from handling any new work
worker.pause();
Resume the worker to handle any new work
worker.start();
Get an existing job from redis with its current state
worker.getJob(type, id, function(err, job){
// error handling and the retrieved job object
});
param | Description |
---|---|
type | string literal represnting the job type |
id | integer representing the job id |
Get a completed job's result
worker.getJobResult(type, id, function(err, result){
// error handling and the result of the job
});
param | Description |
---|---|
type | string literal represnting the job type |
id | integer representing the job id |
Get an overview of each job type and its status (active, pending, etc...)
worker.getStatus(function(err, status){
// error handling and system status data
});
Job functions are available within the processing function, and can be used freely inside a worker.process()
function
Report and save the current progress of the job
job.reportProgress(step, total);
param | Description |
---|---|
step | integer representing the current step progress from the total |
total | integer representing the total amount of progress steps in the job |
example: job.reportProgress(5,10)
will result in 50% progress for the job
Add a child job to the current job
job.addChild(job);
param | Description |
---|---|
job | a live Job object, usually gathered from a worker.getJob() or worker.createJob() functions |
Gather data from child jobs, previously added via job.addChild()
job.waitForChildren(function(){
// handle data from children
});
done()
can be called inside the job.waitForChildren()
callbacAfter cloning the repo, make sure a local redis instance is running with db1 available (WARNING tests flush all data in db1) and run
npm test
FAQs
job queue for nodejs
The npm package hique receives a total of 3 weekly downloads. As such, hique popularity was classified as not popular.
We found that hique demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.