|
Control.ERNet.Blocks.Basic | Portability | portable | Stability | experimental | Maintainer | mik@konecny.aow.cz |
|
|
|
Description |
Definitions of a few universaly useful simple network processes
and process templates.
|
|
Synopsis |
|
constantProcess :: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => ERProcessName -> (q -> a) -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | constantChangedProcess :: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => ERProcessName -> (q -> a) -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | constantStatefulProcess :: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => ERProcessName -> (s -> (QueryId, q) -> (a, Maybe s)) -> s -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | passThroughProcess :: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> (q1 -> q2) -> (q1 -> a2 -> a1) -> ChannelType -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | maybePassThroughProcess :: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> (q1 -> Bool) -> (q1 -> a1) -> (q1 -> q2) -> (q1 -> a2 -> a1) -> ChannelType -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | passThroughStatefulProcess :: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> (s -> (QueryId, q1) -> (Either q2 a1, Maybe s)) -> (s -> (QueryId, q1) -> a2 -> (Either q2 a1, Maybe s)) -> s -> ChannelType -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | passThroughBinaryStatefulProcess :: (QAProtocol q1 a1, QAProtocol q2 a2, QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> (s -> (QueryId, q) -> (Either (Maybe q1, Maybe q2) a, Maybe s)) -> (s -> (QueryId, q) -> (Maybe a1, Maybe a2) -> (Either (Maybe q1, Maybe q2) a, Maybe s)) -> s -> (ChannelType, ChannelType) -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | passThroughBinaryProcess :: (QAProtocol q1 a1, QAProtocol q2 a2, QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> (q -> (q1, q2)) -> (q -> (a1, a2) -> a) -> (ChannelType, ChannelType) -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | rateProcess :: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => ERProcessName -> (a -> a -> Bool) -> Int -> ChannelType -> ERProcess sInAnyProt sOutAnyProt | | precProcess :: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) => Bool -> ERProcessName -> ChannelType -> a -> ERProcess sInAnyProt sOutAnyProt |
|
|
Documentation |
|
|
:: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => ERProcessName | process identifier (string)
| -> q -> a | function to answer queries
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A generic stateless process with no inputs.
|
|
|
|
:: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => ERProcessName | process identifier (string)
| -> q -> a | function to answer queries (without the ChTChanges wrapper)
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A generic process with no inputs that answers using a ChTChanges protocol.
|
|
|
|
:: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => ERProcessName | process identifier (string)
| -> s -> (QueryId, q) -> (a, Maybe s) | function to answer queries and transform state
| -> s | initial state
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A generic stateful process with no inputs.
|
|
|
|
:: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) | | => Bool | should use channel cache?
| -> ERProcessName | | -> q1 -> q2 | query translator
| -> q1 -> a2 -> a1 | answer translator
| -> ChannelType | argument channel type
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A simple process that passes on a translated version of each query
to another process and translates the answers before passing them back.
|
|
|
|
:: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) | | => Bool | should use channel cache?
| -> ERProcessName | | -> q1 -> Bool | if True, query should NOT be passed on
| -> q1 -> a1 | responder to use if not passing queries on
| -> q1 -> q2 | translator for queries to pass on
| -> q1 -> a2 -> a1 | translator for passed answers
| -> ChannelType | input channel type
| -> ChannelType | output channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A simple process that either responds with no further queries
or passes on a translated version of the query to another process,
and then passing back a translated version of the answer received.
|
|
|
passThroughStatefulProcess | Source |
|
:: (QAProtocol q1 a1, QAProtocol q2 a2, Channel sIn sOut sInAnyProt sOutAnyProt) | | => Bool | should use channel cache?
| -> ERProcessName | | -> s -> (QueryId, q1) -> (Either q2 a1, Maybe s) | what to do with a query + forward or reply
| -> s -> (QueryId, q1) -> a2 -> (Either q2 a1, Maybe s) | what to do with an answer - another query or reply
| -> s | initial state
| -> ChannelType | argument channel type
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A process that passes on a translated version of each query
to another process. When the other other answers, it analyses
the answer and decides whether to send another query or
answer its original query.
Several simpler processes are defined as specialisations of this one.
|
|
|
passThroughBinaryStatefulProcess | Source |
|
:: (QAProtocol q1 a1, QAProtocol q2 a2, QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => Bool | should use channel cache?
| -> ERProcessName | | -> s -> (QueryId, q) -> (Either (Maybe q1, Maybe q2) a, Maybe s) | what to do with a query + forward or reply
| -> s -> (QueryId, q) -> (Maybe a1, Maybe a2) -> (Either (Maybe q1, Maybe q2) a, Maybe s) | what to do with an answer - another query or reply
| -> s | initial state
| -> (ChannelType, ChannelType) | argument channels types
| -> ChannelType | result channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A process that passes on a translated version of each query
to one or both of another 2 channels. When the other channel(s) answer,
it analyses the answer(s) and decides whether to send other queries or
answer its original query.
|
|
|
passThroughBinaryProcess | Source |
|
|
|
|
:: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => ERProcessName | process identifier (string)
| -> a -> a -> Bool | function to judge whether the improvement is good enough
| -> Int | maximum number of attempts to reach desired improvement
| -> ChannelType | number channel type
| -> ERProcess sInAnyProt sOutAnyProt | | A process passing on information without modification, except for improving the
convergence rate in successive queries.
Each query may refer to a previous query. When it does,
the query will not be answered until either:
- the answer has improved sufficiently since last time one was given
- the number of queries made in response to this query has reached the given limit
Currently supports only single-threaded querying.
|
|
|
|
:: (QAProtocol q a, Channel sIn sOut sInAnyProt sOutAnyProt) | | => Bool | should use channel cache?
| -> ERProcessName | | -> ChannelType | in, out channel type
| -> a | sample answer (without QAIxA) to identify protocol type
| -> ERProcess sInAnyProt sOutAnyProt | | A trivial passthrough process that only:
- reduces prec by 1 in all queries
- ensures that the granularity of all answers is raised to prec
|
|
|
Produced by Haddock version 2.4.2 |