
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@rbxts/task-queue
Advanced tools
Queue of cancellable tasks that is shifted and resumed whenever a task finishes
In the example below, we add two tasks to the queue, and the first one yields longer than the main thread does. Because the cancel request is sent before the task.wait(3) in the first task had finished, "b" and "c" will not print.
import TaskQueue from "@rbxts/task-queue";
const queue = new TaskQueue();
queue.AddTask(() => {
print("a");
task.wait(3);
print("b");
task.wait(1);
});
queue.AddTask(() => {
print("c");
});
task.wait(2);
queue.Clear();
Events can be registered as dependencies for the queue, so that when one of its events is fired, the queue will cancel all the tasks that contains that event.
import { myEvent } from "./events";
queue.AddTask(() => {
task.wait(3);
print("hello there");
}, [myEvent]);
// will prevent the task from printing "hello there"
myEvent.Fire();
Additionally, there is a method exclusive to promises, but the way it works is different from AddTask. Instead of resolving the promise when its thread is consumed by the queue, it'll be cancelled.
const promise = new Promise((resolve) => {
const status = getPlayerStatus();
resolve(status);
}).timeout(60);
queue.AddTask(() => { ... });
// ...
queue.AddPromise(promise);
This is essentially a sugar for:
queue.AddTask(() => {
promise.cancel();
});
FAQs
Queue of cancellable tasks that is shifted and resumed whenever a task finishes
The npm package @rbxts/task-queue receives a total of 0 weekly downloads. As such, @rbxts/task-queue popularity was classified as not popular.
We found that @rbxts/task-queue 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.