distributed-process-fsm-0.0.1: The Cloud Haskell implementation of Erlang/OTP gen_statem

Copyright(c) Tim Watson 2017
LicenseBSD3 (see the file LICENSE)
MaintainerTim Watson <watson.timothy@gmail.com>
Stabilityexperimental
Portabilitynon-portable (requires concurrency)
Safe HaskellNone
LanguageHaskell98

Control.Distributed.Process.FSM.Client

Description

The Client Portion of the FSM API.

Synopsis

Documentation

call :: (Serializable m, Serializable r) => ProcessId -> m -> Process r Source #

Make a synchronous call to the FSM process at ProcessId. If a Step exists that upon receiving an event of type m will eventually reply to the caller, the reply will be the result of evaluating this function. If not, or if the types do not match up, this function will block indefinitely.

callTimeout :: (Serializable m, Serializable r) => ProcessId -> m -> TimeInterval -> Process (Maybe r) Source #

As call but times out if the response does not arrive without the specified TimeInterval. If the call times out, the caller's mailbox is not affected (i.e. no message will arrive at a later time).

safeCall :: (Serializable m, Serializable r) => ProcessId -> m -> Process (Either ExitReason r) Source #

Initiate a call and if an exit signal arrives, return it as Left reason, otherwise evaluate to Right result.