@@ -14,6 +14,11 @@ import GHC.IO.Handle
14import GHC.IO.Handle.FD
14import GHC.IO.Handle.FD
15import GHC.IO.IOMode
15import GHC.IO.IOMode
17+#if MIN_VERSION_stm(2,5,0)
18+import Numeric.Natural
17-- | File owner struct writing data to the file
22-- | File owner struct writing data to the file
18-- sequentially. Automatic buffer flushing and log rotating.
23-- sequentially. Automatic buffer flushing and log rotating.
19data FileOwner = FileOwner
24data FileOwner = FileOwner
@@ -23,16 +28,22 @@ data FileOwner = FileOwner
23 -- ^ Wait for to be sure that worker thread is closed.
28 -- ^ Wait for to be sure that worker thread is closed.
31+#if MIN_VERSION_stm(2,5,0)
32+type QueueLen = Natural
26data FileOwnerSettings = FileOwnerSettings
37data FileOwnerSettings = FileOwnerSettings
27 { fosDebounceFreq :: Maybe Int
38 { fosDebounceFreq :: Maybe Int
28− , fosDataQueueLen :: Int
39+ , fosDataQueueLen :: QueueLen
29− , fosControlQueueLen :: Int
40+ , fosControlQueueLen :: QueueLen
32defaultFileOwnerSettings :: FileOwnerSettings
43defaultFileOwnerSettings :: FileOwnerSettings
33defaultFileOwnerSettings = FileOwnerSettings
44defaultFileOwnerSettings = FileOwnerSettings
34− { fosDebounceFreq = Just 200000 -- every 200ms
45+ { fosDebounceFreq = Just 200000 -- every 200ms
35− , fosDataQueueLen = 1000
46+ , fosDataQueueLen = 1000
36 , fosControlQueueLen = 100
47 , fosControlQueueLen = 100