wait
Await until the message reaches a terminal state (delivered, undelivered, or
failed). Returns the terminal RelayEvent.
Throws an Error if timeout is specified and the message does not
reach a terminal state within the given duration.
Parameters
timeout
Maximum number of milliseconds to wait. undefined waits indefinitely.
Returns
Promise<RelayEvent> — The event that caused the message to
reach its terminal state. Inspect message.state for the final state value.