Skip to content

🔴 Redis API ​

Full IORedis-compatible command surface. Unknown method names are forwarded as registered custom hooks.

Connection ​

ping ​

Health check; returns PONG.

ts
ping(): Promise<string>
ts
const redis = zedgi.redis();
const pong = await redis.ping(); // 'PONG'
python
redis = zedgi.redis()
pong = redis.ping()  # 'PONG'
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "ping",
  "payload": {
    "args": []
  }
}

Strings ​

get ​

Get the string value of a key.

ts
get(key): Promise<string | null>
ts
const redis = zedgi.redis();
const v = await redis.get('user:1:name');
python
redis = zedgi.redis()
v = redis.get('user:1:name')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "get",
  "payload": {
    "args": [
      "user:1:name"
    ]
  }
}

set ​

Set the string value of a key. Extra args map to Redis options (EX, NXâ€Ļ).

ts
set(key, value, ...opts)
ts
const redis = zedgi.redis();
await redis.set('session:abc', token, 'EX', 3600);
python
redis = zedgi.redis()
redis.set('session:abc', token, 'EX', 3600)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "set",
  "payload": {
    "args": [
      "session:abc",
      "token",
      "EX",
      3600
    ]
  }
}

append ​

Append a value to a key.

ts
append(key, value): Promise<number>
ts
const redis = zedgi.redis();
await redis.append('log', 'line\n');
python
redis = zedgi.redis()
redis.call('APPEND', 'log', 'line\n')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "append",
  "payload": {
    "args": [
      "log",
      "line\n"
    ]
  }
}

incr ​

Increment the integer value of a key by one.

ts
incr(key): Promise<number>
ts
const redis = zedgi.redis();
const n = await redis.incr('views');
python
redis = zedgi.redis()
n = redis.incr('views')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "incr",
  "payload": {
    "args": [
      "views"
    ]
  }
}

incrby ​

Increment the integer value of a key by the given amount.

ts
incrby(key, amount): Promise<number>
ts
const redis = zedgi.redis();
await redis.incrby('score', 10);
python
redis = zedgi.redis()
redis.call('INCRBY', 'score', 10)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "incrby",
  "payload": {
    "args": [
      "score",
      10
    ]
  }
}

decr ​

Decrement the integer value of a key by one.

ts
decr(key): Promise<number>
ts
const redis = zedgi.redis();
await redis.decr('stock');
python
redis = zedgi.redis()
redis.call('DECR', 'stock')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "decr",
  "payload": {
    "args": [
      "stock"
    ]
  }
}

mget ​

Get the values of multiple keys.

ts
mget(...keys): Promise<(string|null)[]>
ts
const redis = zedgi.redis();
await redis.call('MGET', 'a', 'b', 'c');
python
redis = zedgi.redis()
redis.call('MGET', 'a', 'b', 'c')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "mget",
  "payload": {
    "args": [
      "a",
      "b",
      "c"
    ]
  }
}

setex ​

Set a key with an expiry in seconds.

ts
setex(key, seconds, value)
ts
const redis = zedgi.redis();
await redis.call('SETEX', 'otp', 300, code);
python
redis = zedgi.redis()
redis.call('SETEX', 'otp', 300, code)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "setex",
  "payload": {
    "args": [
      "otp",
      300,
      "code"
    ]
  }
}

Keys ​

del ​

Delete one or more keys.

ts
del(...keys): Promise<number>
ts
const redis = zedgi.redis();
await redis.del('cache:home', 'cache:about');
python
redis = zedgi.redis()
redis.delete('cache:home', 'cache:about')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "del",
  "payload": {
    "args": [
      "cache:home",
      "cache:about"
    ]
  }
}

exists ​

Check whether one or more keys exist.

ts
exists(...keys): Promise<number>
ts
const redis = zedgi.redis();
await redis.exists('user:1');
python
redis = zedgi.redis()
redis.call('EXISTS', 'user:1')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "exists",
  "payload": {
    "args": [
      "user:1"
    ]
  }
}

expire ​

Set a key’s time-to-live in seconds.

ts
expire(key, seconds): Promise<number>
ts
const redis = zedgi.redis();
await redis.expire('session:abc', 3600);
python
redis = zedgi.redis()
redis.expire('session:abc', 3600)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "expire",
  "payload": {
    "args": [
      "session:abc",
      3600
    ]
  }
}

ttl ​

Get the remaining time-to-live of a key.

ts
ttl(key): Promise<number>
ts
const redis = zedgi.redis();
const ttl = await redis.ttl('session:abc');
python
redis = zedgi.redis()
ttl = redis.call('TTL', 'session:abc')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "ttl",
  "payload": {
    "args": [
      "session:abc"
    ]
  }
}

keys ​

Find all keys matching a pattern (use sparingly).

ts
keys(pattern): Promise<string[]>
ts
const redis = zedgi.redis();
await redis.call('KEYS', 'user:*');
python
redis = zedgi.redis()
redis.call('KEYS', 'user:*')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "keys",
  "payload": {
    "args": [
      "user:*"
    ]
  }
}

type ​

Get the data type stored at a key.

ts
type(key): Promise<string>
ts
const redis = zedgi.redis();
await redis.call('TYPE', 'mylist');
python
redis = zedgi.redis()
redis.call('TYPE', 'mylist')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "type",
  "payload": {
    "args": [
      "mylist"
    ]
  }
}

Hashes ​

hset ​

Set field-value pairs in a hash.

ts
hset(key, ...fieldValues): Promise<number>
ts
const redis = zedgi.redis();
await redis.hset('user:1', 'name', 'Ada', 'age', '36');
python
redis = zedgi.redis()
redis.call('HSET', 'user:1', 'name', 'Ada')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "hset",
  "payload": {
    "args": [
      "user:1",
      "name",
      "Ada",
      "age",
      "36"
    ]
  }
}

hget ​

Get the value of a hash field.

ts
hget(key, field): Promise<string | null>
ts
const redis = zedgi.redis();
await redis.hget('user:1', 'name');
python
redis = zedgi.redis()
redis.hget('user:1', 'name')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "hget",
  "payload": {
    "args": [
      "user:1",
      "name"
    ]
  }
}

hgetall ​

Get all fields and values of a hash.

ts
hgetall(key): Promise<Record<string,string>>
ts
const redis = zedgi.redis();
const u = await redis.hgetall('user:1');
python
redis = zedgi.redis()
u = redis.hgetall('user:1')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "hgetall",
  "payload": {
    "args": [
      "user:1"
    ]
  }
}

hdel ​

Delete one or more hash fields.

ts
hdel(key, ...fields): Promise<number>
ts
const redis = zedgi.redis();
await redis.hdel('user:1', 'age');
python
redis = zedgi.redis()
redis.call('HDEL', 'user:1', 'age')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "hdel",
  "payload": {
    "args": [
      "user:1",
      "age"
    ]
  }
}

hincrby ​

Increment a hash field by an integer.

ts
hincrby(key, field, amount)
ts
const redis = zedgi.redis();
await redis.call('HINCRBY', 'user:1', 'logins', 1);
python
redis = zedgi.redis()
redis.call('HINCRBY', 'user:1', 'logins', 1)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "hincrby",
  "payload": {
    "args": [
      "user:1",
      "logins",
      1
    ]
  }
}

Lists ​

lpush ​

Prepend one or more values to a list.

ts
lpush(key, ...values): Promise<number>
ts
const redis = zedgi.redis();
await redis.lpush('queue', job);
python
redis = zedgi.redis()
redis.call('LPUSH', 'queue', job)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "lpush",
  "payload": {
    "args": [
      "queue",
      "job"
    ]
  }
}

rpush ​

Append one or more values to a list.

ts
rpush(key, ...values): Promise<number>
ts
const redis = zedgi.redis();
await redis.rpush('queue', job);
python
redis = zedgi.redis()
redis.call('RPUSH', 'queue', job)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "rpush",
  "payload": {
    "args": [
      "queue",
      "job"
    ]
  }
}

lpop ​

Remove and return the first element of a list.

ts
lpop(key): Promise<string | null>
ts
const redis = zedgi.redis();
const job = await redis.lpop('queue');
python
redis = zedgi.redis()
job = redis.call('LPOP', 'queue')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "lpop",
  "payload": {
    "args": [
      "queue"
    ]
  }
}

lrange ​

Get a range of elements from a list.

ts
lrange(key, start, stop): Promise<string[]>
ts
const redis = zedgi.redis();
await redis.lrange('queue', 0, -1);
python
redis = zedgi.redis()
redis.lrange('queue', 0, -1)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "lrange",
  "payload": {
    "args": [
      "queue",
      0,
      -1
    ]
  }
}

llen ​

Get the length of a list.

ts
llen(key): Promise<number>
ts
const redis = zedgi.redis();
await redis.call('LLEN', 'queue');
python
redis = zedgi.redis()
redis.call('LLEN', 'queue')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "llen",
  "payload": {
    "args": [
      "queue"
    ]
  }
}

Sets ​

sadd ​

Add one or more members to a set.

ts
sadd(key, ...members): Promise<number>
ts
const redis = zedgi.redis();
await redis.sadd('tags', 'edge', 'redis');
python
redis = zedgi.redis()
redis.call('SADD', 'tags', 'edge')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "sadd",
  "payload": {
    "args": [
      "tags",
      "edge",
      "redis"
    ]
  }
}

smembers ​

Get all members of a set.

ts
smembers(key): Promise<string[]>
ts
const redis = zedgi.redis();
await redis.smembers('tags');
python
redis = zedgi.redis()
redis.call('SMEMBERS', 'tags')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "smembers",
  "payload": {
    "args": [
      "tags"
    ]
  }
}

sismember ​

Check whether a value is a set member.

ts
sismember(key, member): Promise<number>
ts
const redis = zedgi.redis();
await redis.sismember('tags', 'edge');
python
redis = zedgi.redis()
redis.call('SISMEMBER', 'tags', 'edge')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "sismember",
  "payload": {
    "args": [
      "tags",
      "edge"
    ]
  }
}

Sorted Sets ​

zadd ​

Add a member with a score to a sorted set.

ts
zadd(key, score, member): Promise<number>
ts
const redis = zedgi.redis();
await redis.zadd('leaderboard', 100, 'ada');
python
redis = zedgi.redis()
redis.call('ZADD', 'leaderboard', 100, 'ada')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "zadd",
  "payload": {
    "args": [
      "leaderboard",
      100,
      "ada"
    ]
  }
}

zrange ​

Return a range of members by index.

ts
zrange(key, start, stop): Promise<string[]>
ts
const redis = zedgi.redis();
await redis.zrange('leaderboard', 0, 9);
python
redis = zedgi.redis()
redis.call('ZRANGE', 'leaderboard', 0, 9)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "zrange",
  "payload": {
    "args": [
      "leaderboard",
      0,
      9
    ]
  }
}

zscore ​

Get the score of a member.

ts
zscore(key, member): Promise<string | null>
ts
const redis = zedgi.redis();
await redis.zscore('leaderboard', 'ada');
python
redis = zedgi.redis()
redis.call('ZSCORE', 'leaderboard', 'ada')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "zscore",
  "payload": {
    "args": [
      "leaderboard",
      "ada"
    ]
  }
}

Advanced ​

call ​

Run any Redis command not exposed as a named method.

ts
call(command, ...args): Promise<unknown>
ts
const redis = zedgi.redis();
await redis.call('SET', 'k', 'v', 'EX', 60);
python
redis = zedgi.redis()
redis.call('SET', 'k', 'v', 'EX', 60)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "call",
  "payload": {
    "command": "SET",
    "args": [
      "k",
      "v",
      "EX",
      60
    ]
  }
}

pipeline ​

Run several commands in one round-trip (no transaction).

ts
pipeline(commands): Promise<unknown[]>
ts
const redis = zedgi.redis();
await redis.pipeline([
  { command: 'SET', args: ['a', '1'] },
  { command: 'INCR', args: ['a'] },
]);
python
redis = zedgi.redis()
redis._t.call('redis', 'pipeline', {
  'commands': [
    {'command': 'SET', 'args': ['a', '1']},
    {'command': 'INCR', 'args': ['a']},
  ]
})
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "pipeline",
  "payload": {
    "commands": [
      {
        "command": "SET",
        "args": [
          "a",
          "1"
        ]
      },
      {
        "command": "INCR",
        "args": [
          "a"
        ]
      }
    ]
  }
}

multi ​

Run several commands atomically in a MULTI/EXEC transaction.

ts
multi(commands): Promise<unknown[]>
ts
const redis = zedgi.redis();
await redis.multi([
  { command: 'INCR', args: ['orders'] },
  { command: 'RPUSH', args: ['order:log', 'new'] },
]);
python
redis = zedgi.redis()
redis._t.call('redis', 'multi', {
  'commands': [
    {'command': 'INCR', 'args': ['orders']},
    {'command': 'RPUSH', 'args': ['order:log', 'new']},
  ]
})
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "multi",
  "payload": {
    "commands": [
      {
        "command": "INCR",
        "args": [
          "orders"
        ]
      },
      {
        "command": "RPUSH",
        "args": [
          "order:log",
          "new"
        ]
      }
    ]
  }
}

BullMQ ​

add ​

Add a job to a queue. args = [jobName, data?, opts?].

ts
add(jobName, data?, opts?): Promise<Job>
ts
const queue = zedgi.queue('emails');
await queue.add('send', { to: 'dev@example.com' }, { attempts: 3 });
python
queue = zedgi.queue('emails')
queue.add('send', {'to': 'dev@example.com'}, {'attempts': 3})
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:add",
  "payload": {
    "target": "emails",
    "args": [
      "send",
      {
        "to": "dev@example.com"
      },
      {
        "attempts": 3
      }
    ]
  }
}

getJob ​

Fetch a single job by id.

ts
getJob(id): Promise<Job | null>
ts
const queue = zedgi.queue('emails');
await queue.getJob('42');
python
queue = zedgi.queue('emails')
queue.get_job('42')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getJob",
  "payload": {
    "target": "emails",
    "args": [
      "42"
    ]
  }
}

getJobs ​

List jobs by state. args = [states?, start?, end?, asc?].

ts
getJobs(states?, start?, end?, asc?)
ts
const queue = zedgi.queue('emails');
await queue.getJobs(['waiting', 'active']);
python
queue = zedgi.queue('emails')
queue.get_jobs(['waiting', 'active'])
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getJobs",
  "payload": {
    "target": "emails",
    "args": [
      [
        "waiting",
        "active"
      ]
    ]
  }
}

getJobCounts ​

Counts per state (waiting/active/completed/failed/â€Ļ).

ts
getJobCounts(...types): Promise<Record<string, number>>
ts
const queue = zedgi.queue('emails');
await queue.getJobCounts();
python
queue = zedgi.queue('emails')
queue.get_job_counts()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getJobCounts",
  "payload": {
    "target": "emails",
    "args": []
  }
}

count ​

Number of jobs waiting to be processed.

ts
count(): Promise<number>
ts
const queue = zedgi.queue('emails');
await queue.count();
python
queue = zedgi.queue('emails')
queue.count()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:count",
  "payload": {
    "target": "emails",
    "args": []
  }
}

pause ​

Pause the queue (stop processing new jobs).

ts
pause(): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.pause();
python
queue = zedgi.queue('emails')
queue.pause()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:pause",
  "payload": {
    "target": "emails",
    "args": []
  }
}

resume ​

Resume a paused queue.

ts
resume(): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.resume();
python
queue = zedgi.queue('emails')
queue.resume()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:resume",
  "payload": {
    "target": "emails",
    "args": []
  }
}

drain ​

Remove waiting + delayed jobs. args = [delayed?].

ts
drain(delayed?): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.drain();
python
queue = zedgi.queue('emails')
queue.drain()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:drain",
  "payload": {
    "target": "emails",
    "args": []
  }
}

clean ​

Remove jobs in a state older than grace ms. args = [grace, limit, type].

ts
clean(grace, limit, type)
ts
const queue = zedgi.queue('emails');
await queue.clean(0, 1000, 'completed');
python
queue = zedgi.queue('emails')
queue.clean(0, 1000, 'completed')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:clean",
  "payload": {
    "target": "emails",
    "args": [
      0,
      1000,
      "completed"
    ]
  }
}

removeJob ​

Remove a single job by id.

ts
removeJob(id): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.removeJob('42');
python
queue = zedgi.queue('emails')
queue.remove_job('42')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:removeJob",
  "payload": {
    "target": "emails",
    "args": [
      "42"
    ]
  }
}

retryJob ​

Retry a failed job by id.

ts
retryJob(id): Promise<{ ok, status }>
ts
const queue = zedgi.queue('emails');
await queue.retryJob('42');
python
queue = zedgi.queue('emails')
queue.retry_job('42')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:retryJob",
  "payload": {
    "target": "emails",
    "args": [
      "42"
    ]
  }
}

promoteJob ​

Promote a delayed job to run now.

ts
promoteJob(id): Promise<{ ok, status }>
ts
const queue = zedgi.queue('emails');
await queue.promoteJob('42');
python
queue = zedgi.queue('emails')
queue.promote_job('42')
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:promoteJob",
  "payload": {
    "target": "emails",
    "args": [
      "42"
    ]
  }
}

obliterate ​

Delete the queue and all of its jobs.

ts
obliterate(opts?): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.obliterate({ force: true });
python
queue = zedgi.queue('emails')
queue.obliterate({'force': True})
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:obliterate",
  "payload": {
    "target": "emails",
    "args": [
      {
        "force": true
      }
    ]
  }
}

closeQueue ​

Close the queue handle on the backend.

ts
closeQueue(): Promise<boolean>
ts
const queue = zedgi.queue('emails');
await queue.closeQueue();
python
queue = zedgi.queue('emails')
queue.close_queue()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:closeQueue",
  "payload": {
    "target": "emails",
    "args": []
  }
}

getSnapshot ​

Counts across all (or named) queues — for dashboards.

ts
getSnapshot(): Promise<Snapshot>
ts
const queue = zedgi.queue('emails');
await queue.getSnapshot();
python
queue = zedgi.queue('emails')
queue.get_snapshot()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getSnapshot",
  "payload": {
    "target": "emails",
    "args": []
  }
}

getEvents ​

Recent queue events (added/active/completed/failed/â€Ļ).

ts
getEvents(): Promise<Event[]>
ts
const queue = zedgi.queue('emails');
await queue.getEvents();
python
queue = zedgi.queue('emails')
queue.get_events()
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getEvents",
  "payload": {
    "target": "emails",
    "args": []
  }
}

getRecentJobsForQueue ​

Most recent jobs for the queue. args = [limit?].

ts
getRecentJobsForQueue(limit?)
ts
const queue = zedgi.queue('emails');
await queue.getRecentJobsForQueue(50);
python
queue = zedgi.queue('emails')
queue.get_recent_jobs_for_queue(50)
http
POST /rpc HTTP/1.1
Host: dev123.zedgi.app
x-zedgi-key: zk_live_xxx
content-type: application/json

{
  "service": "redis",
  "method": "bull:getRecentJobsForQueue",
  "payload": {
    "target": "emails",
    "args": [
      50
    ]
  }
}