ngx-export 1.6.1 → 1.6.2
raw patch · 3 files changed
+27/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ NgxExport: TerminateWorkerProcess :: String -> TerminateWorkerProcess
+ NgxExport: instance GHC.Exception.Type.Exception NgxExport.TerminateWorkerProcess
+ NgxExport: instance GHC.Show.Show NgxExport.TerminateWorkerProcess
+ NgxExport: newtype TerminateWorkerProcess
Files
- Changelog.md +5/−0
- NgxExport.hs +21/−1
- ngx-export.cabal +1/−1
Changelog.md view
@@ -1,3 +1,8 @@+### 1.6.2++- Added exception *TerminateWorkerProcess* that can be used for a little bit+ more graceful termination of the worker process than bare exit(2).+ ### 1.6.1 - Upgraded Cabal version constraint.
NgxExport.hs view
@@ -47,6 +47,8 @@ ,ngxCyclePtr ,ngxUpstreamMainConfPtr ,ngxCachedTimePtr+ -- * Exception /TerminateWorkerProcess/+ ,TerminateWorkerProcess (..) -- * Re-exported data constructors from /Foreign.C/ -- | Re-exports are needed by exporters for marshalling in foreign calls. ,Foreign.C.CInt (..)@@ -480,6 +482,22 @@ instance Show ServiceHookInterrupt where show = const "Service was interrupted by a service hook" +-- | Terminates the worker process.+--+-- Being thrown from a service when that runs for the first time, this+-- exception makes Nginx log the supplied message and terminate the worker+-- process without respawning. This can be useful when the service is unable+-- to read its configuration from the Nginx configuration script or to perform+-- an important initialization action.+--+-- @since 1.6.2+newtype TerminateWorkerProcess =+ TerminateWorkerProcess String -- ^ Contains the message to log++instance Exception TerminateWorkerProcess+instance Show TerminateWorkerProcess where+ show (TerminateWorkerProcess s) = s+ safeMallocBytes :: Int -> IO (Ptr a) safeMallocBytes = flip catchIOError (const $ return nullPtr) . mallocBytes@@ -584,7 +602,9 @@ return (C8L.pack $ show e, (case fromException e of Just ServiceHookInterrupt -> 2- _ -> 1+ _ -> case fromException e of+ Just (TerminateWorkerProcess _) -> 3+ _ -> 1 ,case asyncExceptionFromException e of Just ThreadKilled -> True _ -> False
ngx-export.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-version: 1.6.1+version: 1.6.2 synopsis: Helper module for Nginx haskell module description: Helper module for <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>.