Copyright | (c) Jiasen Wu 2020 |
---|---|
License | BSD-3-Clause |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data DataChannelWithData = forall a.NeptDataType a => DataChannelWithData (DataChannel a, [DataPoint a])
- transmitter :: HasCallStack => NeptuneSession -> Experiment -> IO ()
- createChannel :: forall t. (NeptDataType t, HasCallStack) => NeptuneSession -> ExperimentId -> Text -> IO (DataChannel t)
- getOrCreateChannel :: forall t. NeptDataType t => Proxy t -> ChannelHashMap -> Text -> IO (DataChannel t) -> IO DataChannelAny
- sendChannel :: HasCallStack => NeptuneSession -> ExperimentId -> [DataChannelWithData] -> IO ()
- readTChanAtMost :: Int -> TChan a -> STM [a]
- readTChanFull :: TChan a -> STM [a]
- gatherDataPoints :: forall a. NeptDataType a => Proxy a -> [DataPointAny] -> ([Text], [DataPoint a])
- logE :: MonadIO m => NeptuneBackendConfig -> Text -> m ()
Documentation
data DataChannelWithData Source #
forall a.NeptDataType a => DataChannelWithData (DataChannel a, [DataPoint a]) |
transmitter :: HasCallStack => NeptuneSession -> Experiment -> IO () Source #
Background thread for transmission
createChannel :: forall t. (NeptDataType t, HasCallStack) => NeptuneSession -> ExperimentId -> Text -> IO (DataChannel t) Source #
Create a neptune data channel.
:: forall t. NeptDataType t | |
=> Proxy t | dummy data type |
-> ChannelHashMap | current user channels |
-> Text | channel name |
-> IO (DataChannel t) | creator |
-> IO DataChannelAny |
Get a neptune data channel. If the data channel doesn't exist yet, a data channel will be created and added to the hashmap of current user channels.
sendChannel :: HasCallStack => NeptuneSession -> ExperimentId -> [DataChannelWithData] -> IO () Source #
Send a batch of data in their respective channel.
readTChanAtMost :: Int -> TChan a -> STM [a] Source #
Read at most n
items from the queue, with blocking read at the
first item.
readTChanFull :: TChan a -> STM [a] Source #
Read all items from the queue
gatherDataPoints :: forall a. NeptDataType a => Proxy a -> [DataPointAny] -> ([Text], [DataPoint a]) Source #