pituicat/src/Affection/MessageBus/Class.hs

18 lines
455 B
Haskell
Raw Normal View History

2017-11-27 00:43:43 +00:00
{-# LANGUAGE MultiParamTypeClasses #-}
2017-11-26 21:26:41 +00:00
module Affection.MessageBus.Class where
import Control.Concurrent.STM as STM
import Affection.MessageBus.Message
2017-11-27 00:43:43 +00:00
newtype (Message msg) => Channel msg = Channel (TChan msg)
2017-11-26 21:26:41 +00:00
2017-11-27 00:43:43 +00:00
class (Message msg) => Participant prt msg where
2017-11-27 04:27:52 +00:00
partChannel :: prt -> Channel msg
2017-11-26 21:26:41 +00:00
2017-11-27 04:27:52 +00:00
-- partConnectChannel :: prt -> Channel msg -> IO ()
2017-11-26 21:26:41 +00:00
2017-11-27 04:27:52 +00:00
partListen :: prt -> IO (Maybe msg)
2017-11-26 21:26:41 +00:00
2017-11-27 01:18:23 +00:00
partEmit :: prt -> msg -> IO ()