Constructs a RedisBroker with the given RedisOptions object.
The configuration of the connection. If undefined, will connect over TCP to the default server at localhost.
A RedisBroker that is connected to the specified Redis server.
Quickly disconnects from the Redis server. Should only be called once. Any operations in flight are cancelled.
A Promise that resolves when the connection is servered.
Gently disconnects from the Redis server. Should only be called once.
A Promise that resolves when all operations in flight are executed and the connection is severed.
Publishes the given message to the Redis server.
Publishing is emulated by LPUSH
ing to celery
. Workers use RPOP
to
extract tasks from the queue.
The message to be published. Serialized to UTF-8 encoded
JSON before being LPUSH
ed onto celery
.
A Promise that resolves to the response of the Redis server
after the LPUSH
operation is completed.
Generated using TypeDoc
RedisBroker implements MessageBroker using the Redis in-memory database. Messages are not durable and will not survive a broker restart.