Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@cardstack/queue
Advanced tools
This plugin is for queueing jobs with cardstack hub. It uses pg-boss and by extension, postgresql, to manage queued jobs,
The test suite is configured to talk to a PostgreSQL docker container. You can start it like:
docker run --name cardstack-postgres -d --rm -p 5432:5432 cardstack/pg-test
And stop it like:
docker stop cardstack-postgres
Assuming you've looked up the queues feature from DI etc, e.g.
let queue = env.lookup('hub:queues');
You can subscribe to a job by passing in a handler:
queue.subscribe('my-job', handler, options);
Options are passed directly to pg boss.
Handlers can be sync or async:
queue.subscribe('my-job', () => console.log("sync handler") );
queue.subscribe('my-job', () => { return new Promise() } );
queue.subscribe('my-job', async () => { await stuff(); console.log('done') });
You can then publish jobs to the named queues.
To publish without waiting for the job to complete, use the publish
method:
let jobId = await queue.publish('my-job', {someDataForJob: 123}, options);
// this line executes after the job gets to the db, but before it is executed
To publish and wait for the job to complete, use the publishAndWait
method:
let jobResult = await queue.publishAndWait('my-job', {someDataForJob: 123}, options);
// this line executes after the job is completed
FAQs
Job queueing plugin for @cardstack/hub.
The npm package @cardstack/queue receives a total of 59 weekly downloads. As such, @cardstack/queue popularity was classified as not popular.
We found that @cardstack/queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.