Creates a new SendQueue
Storage backend (default: in-memory)
Maximum queue size (default: 100)
Checks if there are messages to process
Checks if the queue is empty
Checks if the queue is full
Number of messages waiting to be sent
Number of messages currently being sent
Total number of messages in queue
Iterates over all messages
Clears the entire queue
Gets the next queued message for sending
The next message, or undefined if queue is empty
Adds a message to the queue
Message options
The created pending message
Gets all pending messages
Gets all messages in a specific status
Loads pending messages from storage
Marks a message as failed
If max retries exceeded, expires the message.
Message ID
Error message
Marks a message as currently sending
Marks a message as successfully sent
Message ID
Transaction ID from blockchain
Removes all failed/expired messages from the queue
Number of messages removed
Removes all sent messages from the queue
Number of messages removed
Removes a message from the queue
Message ID to remove
true if removed
Resets all failed messages back to queued status
Useful when connectivity is restored.
Saves pending messages to storage
Sets callback for when a message expires (max retries exceeded)
Sets callback for when a message fails (will retry)
Sets callback for when a message is successfully sent
Send Queue
Manages a queue of pending messages for offline support. Messages can be enqueued when offline and processed when online.