ekg-0.2.0.0: Remote monitoring of processes

Safe HaskellSafe-Infered

System.Remote.Counter

Description

This module defines a type for mutable, integer-valued counters. All operations on counters are thread-safe.

Synopsis

Documentation

data Counter Source

A mutable, integer-valued counter.

inc :: Counter -> IO ()Source

Increase the counter by one.

dec :: Counter -> IO ()Source

Decrease the counter by one.

add :: Counter -> Int -> IO ()Source

Increase the counter by the given amount.

subtract :: Counter -> Int -> IO ()Source

Decrease the counter by the given amount.

set :: Counter -> Int -> IO ()Source

Set the counter to the given value.