ngx-export-tools 1.0 → 1.1.0
raw patch · 5 files changed
+18/−8 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- NgxExport.Tools.System: finalizeHTTPRequest :: Int -> Maybe String -> IO ()
+ NgxExport.Tools.System: finalizeHTTPRequest :: Int -> Maybe String -> IO a
- NgxExport.Tools.System: restartWorkerProcess :: String -> IO ()
+ NgxExport.Tools.System: restartWorkerProcess :: String -> IO a
- NgxExport.Tools.System: terminateWorkerProcess :: String -> IO ()
+ NgxExport.Tools.System: terminateWorkerProcess :: String -> IO a
Files
- Changelog.md +6/−0
- LICENSE +1/−1
- NgxExport/Tools/System.hs +4/−4
- NgxExport/Tools/TimeInterval.hs +5/−1
- ngx-export-tools.cabal +2/−2
Changelog.md view
@@ -1,3 +1,9 @@+### 1.1.0++- Use polymorphic return types in functions *terminateWorkerProcess*,+ *restartWorkerProcess*, and *finalizeHTTPRequest* which allows throwing the+ corresponding exceptions in any context.+ ### 1.0 - The whole package was split into five separate sub-modules.
LICENSE view
@@ -1,7 +1,7 @@ The following license covers this documentation, and the source code, except where otherwise indicated. -Copyright 2018-2022, Alexey Radkov. All rights reserved.+Copyright 2018-2023, Alexey Radkov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
NgxExport/Tools/System.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : NgxExport.Tools.System--- Copyright : (c) Alexey Radkov 2018-2022+-- Copyright : (c) Alexey Radkov 2018-2023 -- License : BSD-style -- -- Maintainer : alexey.radkov@gmail.com@@ -47,7 +47,7 @@ -- Nginx master process shall /not/ spawn a new worker process thereafter. This -- function throws exception 'TerminateWorkerProcess', and therefore terminates -- the worker process effectively only from a Haskell service.-terminateWorkerProcess :: String -> IO ()+terminateWorkerProcess :: String -> IO a terminateWorkerProcess = throwIO . TerminateWorkerProcess -- | Restarts the Nginx worker process from a Haskell service.@@ -56,7 +56,7 @@ -- the current one. This function throws exception 'RestartWorkerProcess', and -- therefore terminates the worker process effectively only from a Haskell -- service.-restartWorkerProcess :: String -> IO ()+restartWorkerProcess :: String -> IO a restartWorkerProcess = throwIO . RestartWorkerProcess -- | Finalizes the current HTTP request from a Haskell asynchronous variable@@ -65,7 +65,7 @@ -- This function throws exception 'FinalizeHTTPRequest', and therefore -- terminates the HTTP request effectively only from a Haskell asynchronous -- variable handler.-finalizeHTTPRequest :: Int -> Maybe String -> IO ()+finalizeHTTPRequest :: Int -> Maybe String -> IO a finalizeHTTPRequest = (throwIO .) . FinalizeHTTPRequest -- | Checks that a generic exception is of type 'WorkerProcessIsExiting'.
NgxExport/Tools/TimeInterval.hs view
@@ -36,12 +36,16 @@ -- resolution timeouts. -- | Time intervals.+--+-- Note that /Unset/ is a zero time interval which is equal to 0 seconds,+-- however it is expected to be used differently. In particular, to explicitly+-- express an intention to unset the timeout. data TimeInterval = Hr Int -- ^ Hours | Min Int -- ^ Minutes | Sec Int -- ^ Seconds | HrMin Int Int -- ^ Hours and minutes | MinSec Int Int -- ^ Minutes and seconds- | Unset -- ^ Zero time interval, equal to @Sec 0@+ | Unset -- ^ Zero time interval deriving (Generic, Lift, Read, Show) instance FromJSON TimeInterval
ngx-export-tools.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-tools-version: 1.0+version: 1.1.0 synopsis: Extra tools for Nginx haskell module description: Extra tools for <https://github.com/lyokha/nginx-haskell-module Nginx haskell module>.@@ -10,7 +10,7 @@ author: Alexey Radkov <alexey.radkov@gmail.com> maintainer: Alexey Radkov <alexey.radkov@gmail.com> stability: stable-copyright: 2018-2022 Alexey Radkov+copyright: 2018-2023 Alexey Radkov category: Network build-type: Simple cabal-version: 1.20