diff options
Diffstat (limited to 'Announcer.hs')
-rw-r--r-- | Announcer.hs | 7 |
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 | ||
30 | import Data.Wrapper.PSQ as PSQ | 30 | import Data.Wrapper.PSQ as PSQ |
31 | 31 | ||
32 | import Control.Applicative | ||
32 | import Control.Concurrent.Lifted.Instrument | 33 | import Control.Concurrent.Lifted.Instrument |
33 | import Control.Concurrent.STM | 34 | import Control.Concurrent.STM |
34 | import Control.Monad | 35 | import Control.Monad |
35 | import Control.Applicative | ||
36 | import Data.ByteString (ByteString) | 36 | import Data.ByteString (ByteString) |
37 | import qualified Data.ByteString.Char8 as Char8 | 37 | import qualified Data.ByteString.Char8 as Char8 |
38 | import Data.Hashable | 38 | import Data.Hashable |
39 | import Data.Time.Clock.POSIX | 39 | import Data.Time.Clock.POSIX |
40 | import qualified GHC.Generics as Generics | 40 | import qualified GHC.Generics as Generics |
41 | -- import Generic.Data.Internal.Meta as Lyxia | 41 | -- import Generic.Data.Internal.Meta as Lyxia |
42 | 42 | ||
43 | newtype AnnounceKey = AnnounceKey ByteString | 43 | newtype AnnounceKey = AnnounceKey ByteString |
@@ -134,9 +134,6 @@ readTChanTimeout :: TVar Bool -> TChan a -> STM (Maybe a) | |||
134 | readTChanTimeout delay pktChannel = do | 134 | readTChanTimeout delay pktChannel = do |
135 | Just <$> readTChan pktChannel <|> pure Nothing <* (readTVar >=> check) delay | 135 | Just <$> readTChan pktChannel <|> pure Nothing <* (readTVar >=> check) delay |
136 | 136 | ||
137 | toMicroseconds :: POSIXTime -> Int | ||
138 | toMicroseconds = round . (* 1000) . (* 1000) | ||
139 | |||
140 | data SchedulerCommand | 137 | data 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) |