ngx-export 1.7.0.1 → 1.7.1
raw patch · 3 files changed
+24/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ NgxExport: ngxCachedPid :: IO CPid
Files
- Changelog.md +5/−0
- NgxExport.hs +18/−1
- ngx-export.cabal +1/−1
Changelog.md view
@@ -1,3 +1,8 @@+### 1.7.1++- Added function *ngxCachedPid* to return the PID of the current worker process+ cached in Nginx.+ ### 1.7.0 - Now basic synchronous and all asynchronous content handlers are expected to
NgxExport.hs view
@@ -44,10 +44,13 @@ ,ngxExportAsyncHandlerOnReqBody -- *** Service hooks ,ngxExportServiceHook- -- * Opaque pointers to Nginx global objects+ -- * Accessing Nginx global objects+ -- *** Opaque pointers ,ngxCyclePtr ,ngxUpstreamMainConfPtr ,ngxCachedTimePtr+ -- *** Primitive objects+ ,ngxCachedPid -- * Accessing Nginx core functionality from Haskell handlers ,TerminateWorkerProcess (..) ,RestartWorkerProcess (..)@@ -1034,6 +1037,12 @@ ngxCachedTimePtr :: IO (Ptr (Ptr ())) ngxCachedTimePtr = readIORef ngxCachedTimePtrStore +-- | Returns the /PID/ of the current worker process cached in Nginx.+--+-- @since 1.7.1+ngxCachedPid :: IO CPid+ngxCachedPid = readIORef ngxCachedPidStore+ foreign export ccall ngxExportSetCyclePtr :: Ptr () -> IO () ngxExportSetCyclePtr :: Ptr () -> IO () ngxExportSetCyclePtr = writeIORef ngxCyclePtrStore@@ -1046,6 +1055,10 @@ ngxExportSetCachedTimePtr :: Ptr (Ptr ()) -> IO () ngxExportSetCachedTimePtr = writeIORef ngxCachedTimePtrStore +foreign export ccall ngxExportSetCachedPid :: CPid -> IO ()+ngxExportSetCachedPid :: CPid -> IO ()+ngxExportSetCachedPid = writeIORef ngxCachedPidStore+ ngxCyclePtrStore :: IORef (Ptr ()) ngxCyclePtrStore = unsafePerformIO $ newIORef nullPtr {-# NOINLINE ngxCyclePtrStore #-}@@ -1057,4 +1070,8 @@ ngxCachedTimePtrStore :: IORef (Ptr (Ptr ())) ngxCachedTimePtrStore = unsafePerformIO $ newIORef nullPtr {-# NOINLINE ngxCachedTimePtrStore #-}++ngxCachedPidStore :: IORef CPid+ngxCachedPidStore = unsafePerformIO $ newIORef (-1)+{-# NOINLINE ngxCachedPidStore #-}
ngx-export.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-version: 1.7.0.1+version: 1.7.1 synopsis: Helper module for Nginx haskell module description: Helper module for <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>.