Safe Haskell | Safe-Inferred |
---|
The module is implementing the LINX signal concept, which is the user level payload exchanged between two services.
- data Signal
- = Signal {
- sigNo :: !SigNo
- sigData :: !ByteString
- | NumericSignal { }
- | NoSignal
- = Signal {
- data SignalSelector
- newtype SigNo = SigNo Int32
- class PayloadSize a where
- payloadSize :: a -> Length
- encode :: Binary a => a -> ByteString
- decode :: Binary a => ByteString -> a
Documentation
A signal - user lever payload data - is coded into three
different fields in the gateway protocol: Signal length in bytes,
including signal number. Signal number. Array of signal data. Even
in the case of NoSignal
the binary encoding is eight bytes.
Signal | A full bodied signal with number and data. |
| |
NumericSignal | A signal data only is carrying a signal number, but no data. |
NoSignal | An |
data SignalSelector Source
A signal selector is used to filter which signals to expect when calling receive. It can either be one of two specific filters - AnySignal or Cancel - or a generic filter.
Signal number descriptor.
class PayloadSize a whereSource
Type class to determine the size of a signal.
payloadSize :: a -> LengthSource
PayloadSize SignalSelector | |
PayloadSize Signal | PayloadSize instances. |
encode :: Binary a => a -> ByteString
Encode a value using binary serialisation to a lazy ByteString.
decode :: Binary a => ByteString -> a
Decode a value from a lazy ByteString, reconstructing the original structure.