Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storage-based-queue

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storage-based-queue

Simply queue manager

  • 0.0.5-alpha2.1
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-47.37%
Maintainers
1
Weekly downloads
 
Created
Source

npm version Build Status Coverage Status Dependency Status devDependencies Status Known Vulnerabilities

Storage Based Queue on Browser

Storage based queue processing mechanism. Today, many backend technology is a simple derivative of the queuing systems used in the browser environment.

You can run jobs over the channels as asynchronous that saved regularly.

This library just a solution method for some use cases. Today, there are different technologies that fulfill the similar process.

How it works?

Data regularly store (local storage for now) added to queue pool. Storing queue data is also inspired by the JSON-RPC method. When the queue is started, the queues start to be processed sequentially in the specified range according to the sorting algorithm.

If any exceptions occur while the worker classes are processing, the current queue is reprocessed to try again. The task is frozen when it reaches the defined retry value.

Channels

You need to create at least one channel. One channel can be created as many channels as desired. Channels run independently of each other. The areas where each channel will store tasks are also separate. The area where tasks are stored is named with the channel name and prefix.

The important thing to remember here is that each newly created channel is actually a new copy of the Queue class. So a new instance is formed, but the dependencies of the channels are still alive as singletons.

Example; You created two channels. Their names are channelA and channelB. If you make a setting in the channelA instance, this change will also be reflected in channelB and all other channels.

Workers

Worker classes should return boolean (true / false) data with the Promise class as the return value. The return Promise / resolve (true) must be true if a task is successfully completed and you want to pass the next task. A possible exception should also be tried again: Promise / resolve (false). If we do not want the task to be retried and we want to pass the next task: Promise / reject ('any value')

Installation

$ npm install storage-based-queue --save

import:

import Queue from 'storage-based-queue';

Documentaion

Click for detailed documentation

License

MIT license

Keywords

FAQs

Package last updated on 30 Dec 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc