Logical block storage which uses two backing stores to implement a buffer.
New blocks are written to the buffer store, which can be flushed to write all of the blocks to the primary store. Reads return a unified view of the existing and buffered blocks.
Logical block storage which uses two backing stores to implement a buffer. New blocks are written to the _buffer_ store, which can be flushed to write all of the blocks to the _primary_ store. Reads return a unified view of the existing and buffered blocks.
(buffer-block-store & {:as opts})
Create a new buffering block store.
:buffer
Block store to use for new writes.:primary
Block store to use for flushed blocks.:predicate
(optional)
A predicate function which should return false for blocks which should not
be buffered; instead, they will be written directly to the primary store.Create a new buffering block store. - `:buffer` Block store to use for new writes. - `:primary` Block store to use for flushed blocks. - `:predicate` (optional) A predicate function which should return false for blocks which should not be buffered; instead, they will be written directly to the primary store.
(clear! store)
Remove all blocks from the buffer. Returns a deferred which yields a summary of the deleted blocks.
Remove all blocks from the buffer. Returns a deferred which yields a summary of the deleted blocks.
(flush! store)
Flush the store, writing all buffered blocks to the primary store. Returns a deferred which yields a summary of the flushed blocks.
Flush the store, writing all buffered blocks to the primary store. Returns a deferred which yields a summary of the flushed blocks.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close