Skip to content

Latest commit

 

History

History
184 lines (108 loc) · 4.99 KB

Message.md

File metadata and controls

184 lines (108 loc) · 4.99 KB

RedisSMQ / Docs / API Reference / Message

Class: Message

The Message class provides methods for interacting with Redis-SMQ messages. It utilizes the RedisClientInstance to perform operations on Redis.

Table of contents

Constructors

Methods

Constructors

constructor

new Message(): Message

Returns

Message

Methods

deleteMessageById

deleteMessageById(id, cb): void

Deletes a message with the given ID.

Parameters

Name Type Description
id string The ID of the message to delete.
cb ICallback<void> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined.

Returns

void


deleteMessagesByIds

deleteMessagesByIds(ids, cb): void

Deletes messages with the given IDs.

Parameters

Name Type Description
ids string[] An array of IDs of the messages to delete.
cb ICallback<void> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined.

Returns

void


getMessageById

getMessageById(messageId, cb): void

Retrieves a message with the given ID.

Parameters

Name Type Description
messageId string The ID of the message to retrieve.
cb ICallback<IMessageTransferable> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the message object.

Returns

void


getMessageState

getMessageState(messageId, cb): void

Retrieves the state of a message with the given ID.

Parameters

Name Type Description
messageId string The ID of the message to retrieve the state for.
cb ICallback<IMessageStateTransferable> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the state of the message.

Returns

void


getMessageStatus

getMessageStatus(messageId, cb): void

Retrieves the status of a message with the given ID.

Parameters

Name Type Description
messageId string The ID of the message to retrieve the status for.
cb ICallback<EMessagePropertyStatus> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be the status of the message.

Returns

void


getMessagesByIds

getMessagesByIds(messageIds, cb): void

Retrieves messages with the given IDs.

Parameters

Name Type Description
messageIds string[] An array of IDs of the messages to retrieve.
cb ICallback<IMessageTransferable[]> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be an array of message objects.

Returns

void


requeueMessageById

requeueMessageById(messageId, cb): void

Requeues a message with the given ID.

Parameters

Name Type Description
messageId string The ID of the message to requeue.
cb ICallback<void> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined.

Returns

void


shutdown

shutdown(cb): void

Shuts down the Redis client and performs cleanup operations.

Parameters

Name Type Description
cb ICallback<void> A callback function that will be called with the result. If an error occurs, the first parameter will be an Error object. Otherwise, the second parameter will be undefined.

Returns

void