
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@cityssm/unique-timed-entry-queue
Advanced tools
A queue with delayed enqueue of unique entries, perfect for queuing update notifications.
A queue with delayed enqueue of unique entries, perfect for queuing update notifications.
For use in scenarios where, for example, a user can trigger a notification after updating a record, but may perform several updates close together, and in the end only one notification should be sent.
npm install @cityssm/unique-timed-entry-queue
import UniqueTimedEntryQueue from '@cityssm/unique-timed-entry-queue'
// Initialize a queue that adds entries after a 5 minute delay.
const queue = new UniqueTimedEntryQueue(5 * 60_000)
// Add a work order number to the queue.
queue.enqueue('WO.26.00001')
// Check the queue immediately. It's empty.
console.log(queue.size())
// => 0
// Wait 5 minutes, plus a second.
await wait(5 * 60_000 + 1000)
// Check the queue. The work order is now there.
console.log(queue.size())
// => 1
Supports all of the standard queue functions for using the queue, along with additional functions for managing the pending entries.
enqueue(entry, [entryDelayMilliseconds])
enqueueAll(entries, [entryDelayMilliseconds])
Adds an entry (or entries) to the queue after the specified delay.
The enqueue delay can optionally be overridden for the specific entry.
If the entry is still waiting to be added to the queue,
the delay will be reset.
dequeue()
Dequeues an entry from the queue.
size()
Returns the size of the queue.
pendingSize()
Returns the number of entries waiting to be added to the queue.
isEmpty()
Returns true if the queue is empty.
hasPending()
Returns true if there are pending entries.
hasPendingEntry(entry)
Returns true if the entry is waiting to be added to the queue.
clear()
Clears all queue entries.
clearPending()
Clears all pending queue entries.
clearPendingEntry(entry)
Clears a specific pending entry.
clearAll()
Clears all queue entries, and all pending entries.
This queue uses timeouts for moving pending entries to the queue. These timeouts are cancelled automatically when the application quits, however they may need to be cancelled manually if the queue is no longer needed.
To ensure all timeouts are cancelled and that garbage collection can run,
include clearPending() or clearAll() in your cleanup process.
ShiftLog
A work management system with work order recording, shift activity logging, and timesheet tracking.
Uses a UniqueTimedEntryQueue to dispatch notifications when work orders have been updated.
FAQs
A queue with delayed enqueue of unique entries, perfect for queuing update notifications.
The npm package @cityssm/unique-timed-entry-queue receives a total of 56 weekly downloads. As such, @cityssm/unique-timed-entry-queue popularity was classified as not popular.
We found that @cityssm/unique-timed-entry-queue demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.