class NATS::JetStream::PullSubscription
- NATS::JetStream::PullSubscription
- Reference
- Object
Defined in:
jetstream/pull_subscription.crConstructors
Instance Method Summary
-
#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.
-
#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. - #consumer : Consumer
- #fetch(timeout : Time::Span = 2.seconds)
- #fetch(message_count : Int, timeout : Time::Span = 2.seconds, no_wait : Bool = false, max_bytes : Int | Nil = nil) : Enumerable(Message)
Constructor Detail
Instance Method Detail
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
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.