summaryrefslogtreecommitdiff
path: root/trivmix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-09-03 23:54:26 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-09-03 23:54:26 +0200
commit6b2a21404d2a4fa2c17c4cf36defe0623016b025 (patch)
treed06db15fc8e902647c79549c3b443e8dede0080d /trivmix
parentd93226b3ad30e65a607a0ee47acd32de844d312c (diff)
downloadtrivmix-6b2a21404d2a4fa2c17c4cf36defe0623016b025.tar
trivmix-6b2a21404d2a4fa2c17c4cf36defe0623016b025.tar.gz
trivmix-6b2a21404d2a4fa2c17c4cf36defe0623016b025.tar.bz2
trivmix-6b2a21404d2a4fa2c17c4cf36defe0623016b025.tar.xz
trivmix-6b2a21404d2a4fa2c17c4cf36defe0623016b025.zip
systemd notify
Diffstat (limited to 'trivmix')
-rw-r--r--trivmix/Trivmix.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/trivmix/Trivmix.hs b/trivmix/Trivmix.hs
index 50caa1b..493c964 100644
--- a/trivmix/Trivmix.hs
+++ b/trivmix/Trivmix.hs
@@ -16,6 +16,8 @@ import System.Posix.Types
16import System.Environment 16import System.Environment
17import System.Process 17import System.Process
18 18
19import System.Systemd.Daemon (notifyReady)
20
19import Control.Concurrent 21import Control.Concurrent
20import Control.Concurrent.MVar 22import Control.Concurrent.MVar
21import Control.Concurrent.Chan 23import Control.Concurrent.Chan
@@ -142,6 +144,7 @@ trivmix Options{..} = do
142 Jack.withActivation client' . Trans.lift $ do 144 Jack.withActivation client' . Trans.lift $ do
143 forM_ run $ \script -> 145 forM_ run $ \script ->
144 (callProcess script [client ++ ":" ++ input, client ++ ":" ++ output]) `catch` (\code -> hPutStrLn stderr $ script ++ " failed: " ++ show (code :: ExitCode)) 146 (callProcess script [client ++ ":" ++ input, client ++ ":" ++ output]) `catch` (\code -> hPutStrLn stderr $ script ++ " failed: " ++ show (code :: ExitCode))
147 notifyReady
145 forever $ threadDelay 1000000 148 forever $ threadDelay 1000000
146 149
147mix :: MVar Level -> CFloat -> IO CFloat 150mix :: MVar Level -> CFloat -> IO CFloat