zoom-cache-1.2.1.0: A streamable, seekable, zoomable cache file format

Portabilityunknown
Stabilityunstable
MaintainerConrad Parker <conrad@metadecks.org>

Data.ZoomCache.Write

Contents

Description

Writing of ZoomCache files.

Synopsis

The ZoomWrite class

class ZoomWrite t whereSource

The ZoomWrite class provides write, a method to write a Haskell value to an open ZoomCache file.

Methods

write :: TrackNo -> t -> ZoomW ()Source

Write a value to an open ZoomCache file.

Instance helpers

The ZoomW monad

type ZoomW = StateT ZoomWHandle IOSource

A StateT IO monad for writing a ZoomCache file

withFileWriteSource

Arguments

:: TrackMap 
-> Maybe UTCTime 
-> Bool

Whether or not to write raw data packets. If False, only summary blocks are written.

-> ZoomW () 
-> FilePath 
-> IO () 

Run a ZoomW () action on a given file handle, using the specified TrackMap specification

flush :: ZoomW ()Source

Force a flush of ZoomCache summary blocks to disk. It is not usually necessary to call this function as summary blocks are transparently written at regular intervals.

ZoomWHandle IO functions

openWriteSource

Arguments

:: TrackMap 
-> Maybe UTCTime 
-> Bool

Whether or not to write raw data packets. If False, only summary blocks are written.

-> FilePath 
-> IO ZoomWHandle 

Open a new ZoomCache file for writing, using a specified TrackMap.

Watermarks

watermark :: TrackNo -> ZoomW (Maybe Int)Source

Query the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.

setWatermark :: TrackNo -> Int -> ZoomW ()Source

Set the maximum number of data points to buffer for a given track before forcing a flush of all buffered data and summaries.