module NgxExport.Tools.SplitService (
splitService
,ignitionService
,deferredService
,NgxExportService
) where
import NgxExport.Tools.Types (NgxExportService)
import qualified Data.ByteString.Lazy as L
splitService :: (a -> IO L.ByteString)
-> (a -> IO L.ByteString)
-> a
-> NgxExportService
splitService :: forall a.
(a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService
splitService a -> IO ByteString
is a -> IO ByteString
ds a
c Bool
fstRun
| Bool
fstRun = a -> IO ByteString
is a
c
| Bool
otherwise = a -> IO ByteString
ds a
c
ignitionService :: (a -> IO L.ByteString)
-> a
-> NgxExportService
ignitionService :: forall a. (a -> IO ByteString) -> a -> NgxExportService
ignitionService a -> IO ByteString
is = (a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService
forall a.
(a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService
splitService a -> IO ByteString
is ((a -> IO ByteString) -> a -> NgxExportService)
-> (a -> IO ByteString) -> a -> NgxExportService
forall a b. (a -> b) -> a -> b
$ IO ByteString -> a -> IO ByteString
forall a b. a -> b -> a
const (IO ByteString -> a -> IO ByteString)
-> IO ByteString -> a -> IO ByteString
forall a b. (a -> b) -> a -> b
$ ByteString -> IO ByteString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
L.empty
deferredService :: (a -> IO L.ByteString)
-> a
-> NgxExportService
deferredService :: forall a. (a -> IO ByteString) -> a -> NgxExportService
deferredService = (a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService
forall a.
(a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService
splitService ((a -> IO ByteString)
-> (a -> IO ByteString) -> a -> NgxExportService)
-> (a -> IO ByteString)
-> (a -> IO ByteString)
-> a
-> NgxExportService
forall a b. (a -> b) -> a -> b
$ IO ByteString -> a -> IO ByteString
forall a b. a -> b -> a
const (IO ByteString -> a -> IO ByteString)
-> IO ByteString -> a -> IO ByteString
forall a b. (a -> b) -> a -> b
$ ByteString -> IO ByteString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
L.empty