class Crabbit::PublishHandle

Overview

Future-like handle for an asynchronous publish confirmation.

Use #await for fiber-blocking code or #on_confirm to receive the result asynchronously. Registering a callback after completion still invokes it.

Defined in:

crabbit/producer.cr

Instance Method Summary

Instance Method Detail

def await(timeout : Time::Span = @default_timeout) : Confirmation #

Waits for and returns the final confirmation.

Raises TimeoutError if the handle has not resolved within timeout. This wait timeout does not cancel the underlying publish.


[View source]
def completed? : Bool #

Returns whether the publish already has a final outcome.


[View source]
def on_confirm(&callback : Confirmation -> ) : self #

Schedules callback to run once with the final confirmation.

Callbacks run outside the connection reader fiber. Returns self.


[View source]
def publishing_id : UInt64 #

Returns the publishing ID assigned to the message.


[View source]