managed-functions-1.0.0: Remote Management Framework
Safe HaskellSafe-Inferred
LanguageHaskell2010

Managed.Agent

Synopsis

Documentation

fromList :: [(ProbeID, Probe e)] -> Agent e Source #

fromList specialized to Agent

toList :: Agent e -> [(ProbeID, Probe e)] Source #

toList specialized to Agent

(!) :: Agent e -> ProbeID -> Probe e infixl 9 Source #

! specialized to Agent

(!?) :: Agent e -> ProbeID -> Maybe (Probe e) infixl 9 Source #

!? specialized to Agent

invoke Source #

Arguments

:: NFData (Out e) 
=> ProbeID

ID of the probe to be called

-> [In e]

Input parameters

-> Agent e

Agent that contains the probe to be called

-> IO (Either AgentException (Out e)) 

Invokes (calls) a Probe.

This function never throws an exception, instead, an Either is used. Any errors and exceptions caused by incorrect ProbeID, incorrect input parameters, or by the probe call itself are caught and passed as an AgentException.

The result is fully evaluated using force before it's returned (to keep all exceptions inside the Either).

ids :: Agent e -> [ProbeID] Source #

List all Probe IDs

invokeUnsafe :: NFData (Out e) => ProbeID -> [In e] -> Agent e -> IO (Out e) Source #

An unsafe variant of invoke.

This function rethrows all exceptions and errors caused by probe lookup or input parameters. Exceptions caused by probe invocation are rethrown as ProbeRuntimeException.

describe :: Agent e -> ProbeID -> Maybe ProbeDescription Source #

Create a full description of a Probe

describeHuman :: Agent e -> ProbeID -> Maybe String Source #

Create a human-readable description of a probe