Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- fromList :: [(ProbeID, Probe e)] -> Agent e
- toList :: Agent e -> [(ProbeID, Probe e)]
- (!) :: Agent e -> ProbeID -> Probe e
- (!?) :: Agent e -> ProbeID -> Maybe (Probe e)
- invoke :: NFData (Out e) => Agent e -> ProbeID -> [In e] -> IO (Either AgentException (Out e))
- ids :: Agent e -> [ProbeID]
- invokeUnsafe :: NFData (Out e) => Agent e -> ProbeID -> [In e] -> IO (Out e)
- describe :: Agent e -> ProbeID -> Maybe ProbeDescription
- describeEither :: Agent e -> ProbeID -> Either AgentException ProbeDescription
- describeHuman :: Agent e -> ProbeID -> Maybe String
Documentation
:: NFData (Out e) | |
=> Agent e | Agent that contains the probe to be called |
-> ProbeID | ID of the probe to be called |
-> [In e] | Input parameters |
-> 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
).
invokeUnsafe :: NFData (Out e) => Agent e -> ProbeID -> [In 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
describeEither :: Agent e -> ProbeID -> Either AgentException ProbeDescription Source #