bugsnag-hs-0.1.0.0: A Bugsnag client for Haskell.

Safe HaskellNone
LanguageHaskell2010

Data.Buffer

Contents

Description

A buffer for batched write operations. Push individual items into the buffer and provide an operation that writes out batches of them.

Synopsis

Buffer

data Buffer a Source #

A buffer for write operations.

new :: Settings a -> IO (Buffer a) Source #

Creates a new Buffer.

push :: Buffer a -> a -> IO () Source #

Push a new item into the buffer.

flush :: Buffer a -> IO () Source #

Flush the current contents of the buffer.

Settings

data Settings a Source #

Configuration settings for a new Buffer.

defaultSettings :: Settings a Source #

Default Buffer settings. A buffer created by these settings has a size of 1 and writes items out as soon as they come in.

write :: Settings a -> NonEmpty a -> IO () Source #

Function to write a batch of items.

size :: Settings a -> Natural Source #

The maximum amount of items to write in a single batch.

frequencyInMicroSeconds :: Settings a -> Int Source #

The frequency with which the buffer gets flushed automatically.