| Copyright | (c) Alexey Radkov 2018-2023 |
|---|---|
| License | BSD-style |
| Maintainer | alexey.radkov@gmail.com |
| Stability | stable |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
NgxExport.Tools.SplitService
Description
Synopsis
- splitService :: (a -> IO ByteString) -> (a -> IO ByteString) -> a -> NgxExportService
- ignitionService :: (a -> IO ByteString) -> a -> NgxExportService
- deferredService :: (a -> IO ByteString) -> a -> NgxExportService
- type NgxExportService = Bool -> IO ByteString
Split services
Split services split the whole service into two separate actions for the first (ignition service) and the following (deferred service) runs.
Exported functions
Arguments
| :: (a -> IO ByteString) | Ignition service |
| -> (a -> IO ByteString) | Deferred service |
| -> a | Configuration |
| -> NgxExportService |
Sets two different actions as ignition and deferred services.
When used as a single-shot service (in terms of module NgxExport.Tools.SimpleService), the second action only runs on exit of a worker process, and therefore can be used as a cleanup handler.
Arguments
| :: (a -> IO ByteString) | Ignition service |
| -> a | Configuration |
| -> NgxExportService |
Sets an action as an ignition service.
Arguments
| :: (a -> IO ByteString) | Deferred service |
| -> a | Configuration |
| -> NgxExportService |
Sets an action as a deferred service.
When used as a single-shot service (in terms of module NgxExport.Tools.SimpleService), the action only runs on exit of a worker process, and therefore can be used as a cleanup handler.
Type declarations
type NgxExportService Source #
Arguments
| = Bool | First-run flag |
| -> IO ByteString |
Allows writing fancier declarations of services.
For example, service signalUpconf in
type Upconf = [Text] signalUpconf :: Upconf ->Bool->IOByteStringsignalUpconf =voidHandler'. mapConcurrently_ getUrlngxExportSimpleServiceTyped'signalUpconf ''Upconf $PersistentServiceNothing
can be rewritten in a fancier way:
signalUpconf :: Upconf -> NgxExportService
signalUpconf = voidHandler' . mapConcurrently_ getUrl
Since: 1.2.2