LavinMQ::MessageStore
Message store This handles writing msgs to segments on disk Keeping a list of deleted messages in memory and on disk You can shift through the message store, but not requeue msgs That has to be handled at another layer Writes messages to segments on disk Messages are refered to as SegmentPositions Deleted messages are written to acks.#{segment}
Constants
A reader that got through its previous segment at least this fast gets readahead for its next one. A slower reader isn't waiting on the disk, so readahead wouldn't speed it up. Reading a segment a page per fault, without readahead, is faster than this even on slow disks, so a reader that is held back by the disk still gets it.
Constructors
Instance methods
Called without the queue's lock (HTTP API, stats), so @size and @bytesize can change in between the reads
Like #[], as an envelope, with the segment position made from the message
The envelope points into the segment, so it's only valid while the lock guarding the store is held, see #shift_with_lease? for using it outside it
Shifts the next message, under lock, and yields it outside the lock with
its segment kept mapped until the block returns, even if the segment is
deleted or the store closed meanwhile. For deliveries, which can be
suspended in a socket write. Returns false if there was no message.