@@ -14,6 +14,11 @@ import GHC.IO.Handle
1414import GHC.IO.Handle.FD
1515import GHC.IO.IOMode
1616
17+#if MIN_VERSION_stm(2,5,0)
18+import Numeric.Natural
19+#endif
20+
21+
1722-- | File owner struct writing data to the file
1823-- sequentially. Automatic buffer flushing and log rotating.
1924data FileOwner = FileOwner
@@ -23,16 +28,22 @@ data FileOwner = FileOwner
2328 -- ^ Wait for to be sure that worker thread is closed.
2429 }
2530
31+#if MIN_VERSION_stm(2,5,0)
32+type QueueLen = Natural
33+#else
34+type QueueLen = Int
35+#endif
36+
2637data FileOwnerSettings = FileOwnerSettings
2738 { fosDebounceFreq :: Maybe Int
28− , fosDataQueueLen :: Int
29− , fosControlQueueLen :: Int
39+ , fosDataQueueLen :: QueueLen
40+ , fosControlQueueLen :: QueueLen
3041 }
3142
3243defaultFileOwnerSettings :: FileOwnerSettings
3344defaultFileOwnerSettings = FileOwnerSettings
34− { fosDebounceFreq = Just 200000 -- every 200ms
35− , fosDataQueueLen = 1000
45+ { fosDebounceFreq = Just 200000 -- every 200ms
46+ , fosDataQueueLen = 1000
3647 , fosControlQueueLen = 100
3748 }
3849