Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Drivers

Ahmet edited this page May 12, 2018 · 3 revisions

Supported driver/plugin system for custom environments.

Note: Just supported storage driver for now.

Create custom storage driver.

First, you need to create class which having to below methods. Then implement it to your environment logic.

Name Parameter(s) Description Return
get name (string) Take an item from storage by key. Promise <Array>
set key (string), value (Array) Add an item to storage. Promise<any>
has key (string) Item checker in storage. Promise<boolean>
clear key (string) Remove an item from storage Promise<any>

Add your custom storage driver to use.

Queue.use({ storage: MyStorageAdapter });

const queue = new Queue();

Note: You must add the driver before the class instantiate.

That's it.

Clone this wiki locally