
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@stemuli/queue
Advanced tools
This library handles the creation and management of message queues on stemuli.
npm i @stemuli/queueREDIS_SERVER set with the value being the connection string to the redis server. Ask Wade or Femi for this value.- [] queues
- [] jobs
- [] <job-folder>
- [] processors
- <job-folder>.job.ts
- [] <job-folder>
- [] processors
- <job-folder>.job.ts
- index.ts
The Stemuli SystemQueue allows you to easily send messages to one or all services at once. This should be initialized on all services. The developer of the service can choose to process these messages or not. For example, when a new user is added to the db, the auth service publishes a message USER_CREAT_UPDATE_ACTION to the system queue. All service interested in responding to this message will be expected to register a processor for this event. See how to register a processor below.
To initialize the SystemQueue on your service, add the following code to your queue/index.ts file:
./queues/index.ts
import {SystemQueues} from '@stemuli_edu/queue/dist';
import {AUTH_SERVICE_QUEUE, COMMUNICATION_SERVICE_QUEUE, CLASS_SERVICE_QUEUE, EVENT_SERVICE_QUEUE} from '@stemuli_edu/queue/dist';
const Q = SystemQueues.init(AUTH_SERVICE_QUEUE); //replace AUTH_SERVICE_QUEUE with your service queue name imported above.
It is possible to create a custom queue.
./queues/index.ts
import {QueueFactory} from '@stemuli_edu/queue/dist';
const customQueue = new QueueFactory('CustomQueueName').init(); //replace `CustomQueueName` with the name of your custom queue.
./queues/index.ts
import {QueueFactory} from '@stemuli_edu/queue/dist';
import {CommuncationJobs} from './jobs/communication';
const customQueue = new QueueFactory('CustomQueueName').init(); //replace `CustomQueueName` with the name of your custom queue.
const customeQueueAction = new CommuncationJobs(customeQueue)
./queues/jobs/communcation/index.ts
import { IQueues } from '@stemuli_edu/queue/dist';
import ChatJobProcessor from './processors';
import {
CHAT_USER_CREATE_UPDATE_JOB,
CHAT_CHANNEL_CREATE_UPDATE_JOB,
CHAT_SUBSCRIBE_MEMBERS_TO_CHANNEL_JOB
} from '../../inc/constants';
import {StemuliJob} from "@stemuli_edu/queue/dist";
export default class ChatJob extends StemuliJob{
queues: IQueues;
constructor(queues: any, defaultQueue?: string) {
// register the action processors in the contructor
super(queues, defaultQueue);
this.registerProcessor(CHAT_USER_CREATE_UPDATE_JOB, ChatJobProcessor.userCreatedUpdated);
}
// method to add a CHAT_USER_CREATE_UPDATE_JOB job to the queue
async addToChatUserCreateUpdateQueue (data: any, options?: any) {
return this.sendToQueue( CHAT_USER_CREATE_UPDATE_JOB, data, options);
};
};
FAQs
Worker library for STEMuli backend
The npm package @stemuli/queue receives a total of 6 weekly downloads. As such, @stemuli/queue popularity was classified as not popular.
We found that @stemuli/queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.