Class: Firehose::Server::MessageBuffer
- Inherits:
-
Object
- Object
- Firehose::Server::MessageBuffer
- Defined in:
- lib/firehose/server/message_buffer.rb
Overview
Encapsulates a sequence of messages from the server along with their consumer_sequences calculate by offset.
Defined Under Namespace
Classes: Message
Constant Summary collapse
- DEFAULT_SIZE =
Number of messages that Redis buffers for the client if its connection drops, then reconnects.
100
Instance Method Summary collapse
-
#initialize(message_list, channel_sequence, consumer_sequence = nil) ⇒ MessageBuffer
constructor
A new instance of MessageBuffer.
- #remaining_messages ⇒ Object
Constructor Details
#initialize(message_list, channel_sequence, consumer_sequence = nil) ⇒ MessageBuffer
Returns a new instance of MessageBuffer.
12 13 14 15 16 |
# File 'lib/firehose/server/message_buffer.rb', line 12 def initialize(, channel_sequence, consumer_sequence = nil) @message_list = @channel_sequence = channel_sequence.to_i @consumer_sequence = consumer_sequence.to_i end |
Instance Method Details
#remaining_messages ⇒ Object
18 19 20 |
# File 'lib/firehose/server/message_buffer.rb', line 18 def .last() end |