mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[ioredis] Add lpop for Cluster (#43005)
Co-authored-by: thmiyathmary <hayato1023_zero_giga@yahoo.co.jp>
This commit is contained in:
parent
d54b71f203
commit
69bc9ed3f0
3
types/ioredis/index.d.ts
vendored
3
types/ioredis/index.d.ts
vendored
@ -1326,6 +1326,9 @@ declare namespace IORedis {
|
||||
|
||||
rpushBuffer(key: string, ...values: Buffer[]): Promise<number>;
|
||||
|
||||
lpop(key: KeyType, callback: (err: Error, res: string) => void): void;
|
||||
lpop(key: KeyType): Promise<string>;
|
||||
|
||||
lpopBuffer(key: KeyType, callback: (err: Error, res: Buffer) => void): void;
|
||||
lpopBuffer(key: KeyType): Promise<Buffer>;
|
||||
|
||||
|
||||
@ -278,6 +278,18 @@ cluster.decr('key', (err, data) => {
|
||||
// [null, '100']
|
||||
});
|
||||
|
||||
listData.forEach(value => {
|
||||
cluster.rpush('bufferlist', Buffer.from(value));
|
||||
});
|
||||
|
||||
listData.forEach(value => {
|
||||
cluster.lpop('bufferlist', (err, data) => {
|
||||
if (data !== value) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
listData.forEach(value => {
|
||||
cluster.rpushBuffer('bufferlist', Buffer.from(value));
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user