class NATS::JetStream::PullSubscription

Defined in:

jetstream/pull_subscription.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(consumer : NATS::JetStream::Consumer, nats : NATS::Client) #

[View source]

Instance Method Detail

def ack_next(msg : Message, timeout : Time::Span = 2.seconds) #

Acknowledge the given message and request the next in a single round trip to the server to save latency.

pull = js.pull_subscribe(consumer)
# Poll for messages until we get one
until msg = pull.fetch(timeout: 30.seconds)
end
loop do
end

[View source]
def ack_next(msg : Message, count : Int, timeout : Time::Span = 2.seconds, no_wait : Bool = false) #

Acknowledge the given message and request the next count messages in a single round trip to the server to save latency.


[View source]
def consumer : Consumer #

[View source]
def fetch(timeout : Time::Span = 2.seconds) #

[View source]
def fetch(message_count : Int, timeout : Time::Span = 2.seconds, no_wait : Bool = false, max_bytes : Int | Nil = nil) : Enumerable(Message) #

[View source]