[bull] fix: add missing low level methods (#42647)

* fix: add multi and toKey methods

* fix: return pipeline without promise

* test: add test

* style: fix lint
This commit is contained in:
Julian Hundeloh
2020-02-26 11:36:37 -08:00
committed by GitHub
parent fc6d7fec6e
commit f6e3b3cdc6
2 changed files with 15 additions and 0 deletions
+5
View File
@@ -250,3 +250,8 @@ new Queue('profile');
new Queue('profile', 'url');
new Queue('profile', { prefix: 'test' });
new Queue('profile', 'url', { prefix: 'test' });
// Use low-level API
const multi = myQueue.multi();
multi.del(myQueue.toKey('repeat'));
multi.exec();
+10
View File
@@ -746,6 +746,16 @@ declare namespace Bull {
*/
clean(grace: number, status?: JobStatusClean, limit?: number): Promise<Array<Job<T>>>;
/**
* Returns a promise that marks the start of a transaction block.
*/
multi(): Redis.Pipeline;
/**
* Returns the queue specific key.
*/
toKey(queueType: string): string;
/**
* Listens to queue events
*/