13 releases (6 breaking)

0.10.0 May 7, 2024
0.9.0 Dec 29, 2023
0.8.0 Dec 29, 2023
0.7.0 Sep 14, 2023
0.4.8 Apr 29, 2023

#26 in #job-scheduler

Download history 1/week @ 2024-02-08 142/week @ 2024-02-15 7/week @ 2024-02-22 3/week @ 2024-02-29 7/week @ 2024-03-14 36/week @ 2024-03-28 19/week @ 2024-04-04 149/week @ 2024-05-02 16/week @ 2024-05-09

165 downloads per month

MIT license

29KB
731 lines

mq-surreal

SQL

Define Schema

DEFINE TABLE queue SCHEMAFULL;
DEFINE FIELD created_at     ON queue TYPE datetime;
DEFINE FIELD updated_at     ON queue TYPE datetime;
DEFINE FIELD scheduled_at   ON queue TYPE datetime;
DEFINE FIELD locked_at      ON queue TYPE option<datetime>;
DEFINE FIELD queue          ON queue TYPE string;
DEFINE FIELD kind           ON queue TYPE string;
DEFINE FIELD max_attempts   ON queue TYPE number;
DEFINE FIELD attempts       ON queue TYPE number;
DEFINE FIELD priority       ON queue TYPE number;
DEFINE FIELD unique_key     ON queue TYPE option<string>;
DEFINE FIELD lease_time     ON queue TYPE number;
DEFINE FIELD payload        ON queue FLEXIBLE TYPE object;
DEFINE FIELD error_reason   ON queue FLEXIBLE TYPE option<object>;

Requires SurrealDB v1.0.0-beta9+

Dependencies

~60MB
~1M SLoC