Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct { log.BasicLogable // contains filtered or unexported fields }
Base is the base structure for implementing a cache.
func (*Base) AddFlushCallback ¶
func (c *Base) AddFlushCallback(f CallbackFunc)
AddFlushCallback appends the function f to the list of functions that will be called on successful flush of the cache. Note that the callback will not be called if the flush fails. Note also that the callback function will not be called concurrently (within a cache -- if you share the same callback function across multiple caches then, of course, it might be called concurrently).
type CallbackFunc ¶
CallbackFunc is a function that will be called after the cache has been successfully flushed to the table. If the callback function returns an error then the cache will be placed in an error state.
type Completed ¶
type Completed struct { *Base // contains filtered or unexported fields }
Completed is a cache for storing completed polytopes.
func NewCompleted ¶
NewCompleted returns a new cache for completed smooth polytopes. The maximum cache size before flushing is maxSize, and the data will be written to the given table.
type Partial ¶
type Partial struct { *Base C <-chan *partial.State // Partial states can be pulled from the cache via this channel. This channel will be closed when the cache is closed. Note that a cache is unordered: the order in which partial states are recovered from the cache via this channel has no relation to the order in which they were added to the cache. // contains filtered or unexported fields }
Partial is a cache for storing partial state data.
func NewPartial ¶
NewPartial returns a new cache for partial state data. The maximum cache size before flushing is maxSize, and the data will be written to the given table.
func (*Partial) Close ¶
Close closes the cache. Any cached data will be flushed, and the ULIDs used to populate the cache will be deleted from the partial state table. If flushing fails, or if the cache has been placed in an error state via MarkAsFailed, then an attempt will be made to mark the ULIDs as unprocessed.
func (*Partial) MarkAsFailed ¶
func (c *Partial) MarkAsFailed()
MarkAsFailed places the cache in an error state. Upon closing the cache via Close, any cached data will be dropped, and the ULIDs used to populate the cache will be marked as unprocessed.