summaryrefslogtreecommitdiff
path: root/Announcer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Announcer.hs')
-rw-r--r--Announcer.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/Announcer.hs b/Announcer.hs
index 89dc5c3b..c6a04cb1 100644
--- a/Announcer.hs
+++ b/Announcer.hs
@@ -29,15 +29,15 @@ module Announcer
29 29
30import Data.Wrapper.PSQ as PSQ 30import Data.Wrapper.PSQ as PSQ
31 31
32import Control.Applicative
32import Control.Concurrent.Lifted.Instrument 33import Control.Concurrent.Lifted.Instrument
33import Control.Concurrent.STM 34import Control.Concurrent.STM
34import Control.Monad 35import Control.Monad
35import Control.Applicative
36import Data.ByteString (ByteString) 36import Data.ByteString (ByteString)
37import qualified Data.ByteString.Char8 as Char8 37import qualified Data.ByteString.Char8 as Char8
38import Data.Hashable 38import Data.Hashable
39import Data.Time.Clock.POSIX 39import Data.Time.Clock.POSIX
40import qualified GHC.Generics as Generics 40import qualified GHC.Generics as Generics
41-- import Generic.Data.Internal.Meta as Lyxia 41-- import Generic.Data.Internal.Meta as Lyxia
42 42
43newtype AnnounceKey = AnnounceKey ByteString 43newtype AnnounceKey = AnnounceKey ByteString
@@ -134,9 +134,6 @@ readTChanTimeout :: TVar Bool -> TChan a -> STM (Maybe a)
134readTChanTimeout delay pktChannel = do 134readTChanTimeout delay pktChannel = do
135 Just <$> readTChan pktChannel <|> pure Nothing <* (readTVar >=> check) delay 135 Just <$> readTChan pktChannel <|> pure Nothing <* (readTVar >=> check) delay
136 136
137toMicroseconds :: POSIXTime -> Int
138toMicroseconds = round . (* 1000) . (* 1000)
139
140data SchedulerCommand 137data SchedulerCommand
141 = ShutdownScheduler 138 = ShutdownScheduler
142 | ScheduleAction KPS -- run an action at an absolute time (todo: use UTCTime) 139 | ScheduleAction KPS -- run an action at an absolute time (todo: use UTCTime)