Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data DataPoint where
- type DataPointStore = TVar (Map DataPointName DataPoint)
- data DataPointRequestor = DataPointRequestor {
- askDataPoints :: !(TVar Bool)
- dataPointsNames :: !(TVar [DataPointName])
- dataPointsReply :: !(TMVar DataPointValues)
- initDataPointStore :: IO DataPointStore
- initDataPointRequestor :: IO DataPointRequestor
- writeToStore :: DataPointStore -> DataPointName -> DataPoint -> IO ()
- readFromStore :: DataPointStore -> DataPointForwarder IO ()
- askForDataPoints :: DataPointRequestor -> [DataPointName] -> IO DataPointValues
Documentation
Type wrapper for some value of type v
. The only reason we need this
wrapper is an ability to store different values in the same DataPointStore
.
Please note that when the acceptor application will read the value of type v
from the store, this value is just as unstructured JSON, but not Haskell
value of type v
. That's why FromJSON
instance for type v
should be
available for the acceptor application, to decode unstructured JSON.
type DataPointStore = TVar (Map DataPointName DataPoint) Source #
data DataPointRequestor Source #
Since DataPointForward
protocol does not assume the stream of requests/replies,
we use the TVar
s to provide to acceptor's side an ability to ask DataPoint
s
explicitly.
DataPointRequestor | |
|
writeToStore :: DataPointStore -> DataPointName -> DataPoint -> IO () Source #
Write DataPoint
to the store.
readFromStore :: DataPointStore -> DataPointForwarder IO () Source #