Îõ³h*&å%Ç,      !"#$%&'()*+1.2.0(c) Alexey Radkov 2018-2022 BSD-stylealexey.radkov@gmail.comstableportable Safe-Inferredngx-export-tools=Sets two different actions as ignition and deferred services.8When 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.ngx-export-tools&Sets an action as an ignition service.ngx-export-tools%Sets an action as a deferred service.8When 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.ngx-export-toolsIgnition servicengx-export-toolsDeferred servicengx-export-tools Configurationngx-export-toolsFirst-run flagngx-export-toolsIgnition servicengx-export-tools Configurationngx-export-toolsFirst-run flagngx-export-toolsDeferred servicengx-export-tools Configurationngx-export-toolsFirst-run flag(c) Alexey Radkov 2023 BSD-stylealexey.radkov@gmail.comstableportable Safe-Inferred !ngx-export-tools8Runs an effectful computation and then returns an empty ,)This combinator saves printing the final return L.empty1 action in handlers that return unused or empty ,.For example, handler  signalUpconf being declared as an  ?https://github.com/lyokha/nginx-haskell-module#update-callbacksupdate callback in  type Upconf = [Text] signalUpconf :: Upconf -> Bool -> IO L.ByteString signalUpconf upconf = const $ do mapConcurrently_ getUrl upconf return L.empty  'signalUpconf ''Upconf $   Nothing äreturns an empty bytestring which is not used in a meaningful way, therefore it can be rewritten as ÉsignalUpconf :: Upconf -> Bool -> IO L.ByteString signalUpconf = const .  voidHandler . mapConcurrently_ getUrl 6which helps to focus better on the computation itself.ngx-export-toolsTarget computation(c) Alexey Radkov 2018-2023 BSD-stylealexey.radkov@gmail.comstablenon-portable (requires POSIX) Safe-Inferred…ngx-export-tools;Terminates the Nginx worker process from a Haskell service.Nginx master process shall notÈ spawn a new worker process thereafter. This function throws exception -×, and therefore terminates the worker process effectively only from a Haskell service. ngx-export-tools9Restarts the Nginx worker process from a Haskell service.üNginx master process shall spawn a new worker process after termination of the current one. This function throws exception .Ø, and therefore terminates the worker process effectively only from a Haskell service. ngx-export-toolsÓFinalizes the current HTTP request from a Haskell asynchronous variable handler.This function throws exception /ì, and therefore terminates the HTTP request effectively only from a Haskell asynchronous variable handler. ngx-export-tools+Checks that a generic exception is of type 0.’This can be useful to check quickly in an exception handler whether a Haskell service has been interrupted because the worker process is exiting. ngx-export-tools'Unmarshals the value of Nginx variable $_r_ptr/ into a pointer to the Nginx request object.§This is safe to use in request-based Haskell handlers such as synchronous and asynchronous tasks and content handlers, but not in services and their derivatives. In  asynchronousá tasks and content handlers the value must be used as read-only. The value can be passed into a C pluginÚ, however, as opposed to usual functions in Nginx C code, it must be tested against the NULL value. ngx-export-toolsÒReturns the current time as the number of seconds elapsed since the UNIX epoch.¸The value is taken from Nginx core, so no additional system calls get involved. On the other hand, it means that this is only safe to use from an Nginx worker's main thread, i.e. in  synchronous Haskell handlers and  service hooksã. Be also aware that this is a small type casting hack: the value is interpreted as being of type time_tÏ while having been actually wrapped in a bigger C struct as its first element.ngx-export-tools Returns the PID4 of the current worker process cached in Nginx core.  (c) Alexey Radkov 2018-2022 BSD-stylealexey.radkov@gmail.comstableportable Safe-InferredÍÛ_ngx-export-tools=Reads an object of a custom type implementing an instance of 1 from a 2.Returns 3 if reading fails.ngx-export-tools=Reads an object of a custom type implementing an instance of 4 from a 2.Returns 3 if reading fails.ngx-export-toolsòReads a pointer to the Nginx request object followed by an object of a custom type implementing an instance of 1 from a 2.ïThrows an exception if unmarshalling of the request pointer fails. In the second element of the tuple returns 3÷ if reading of the custom object fails. Notice that the value of the returned request pointer is not checked against NULL.ngx-export-toolsòReads a pointer to the Nginx request object followed by an object of a custom type implementing an instance of 4 from a 2.ïThrows an exception if unmarshalling of the request pointer fails. In the second element of the tuple returns 3ø if decoding of the custom object fails. Notice that the value of the returned request pointer is not checked against NULL.ngx-export-toolsÔSkips the number of bytes equal to the size of a pointer from the beginning of a 2.òThis can be useful to drop a pointer to the Nginx request object passed at the beginning of a handler's argument.(c) Alexey Radkov 2018-2022 BSD-stylealexey.radkov@gmail.comstableportable Safe-Inferred$ 5 -> 6 , %with specified name and service mode.*ngx-export-tools Exports a simple service of type 1 a => a -> 5 -> 6 , %with specified name and service mode.ÌThe service expects an object of a custom type implementing an instance of 1á at its first argument. For the sake of efficiency, this object gets deserialized into a global 7• data storage on the first service run to be further accessed directly from this storage. The storage can be accessed from elsewhere by a name comprised of the name of the custom type and the name of the service connected by an underscore and prefixed as a whole word with storage_ . The stored data is wrapped in 8 container.øWhen reading of the custom object fails on the first service run, the service terminates the worker process by calling  with a corresponding message.+ngx-export-tools Exports a simple service of type    a => a -> 5 -> 6 , %with specified name and service mode.ÌThe service expects an object of a custom type implementing an instance of   á at its first argument. For the sake of efficiency, this object gets deserialized into a global 7• data storage on the first service run to be further accessed directly from this storage. The storage can be accessed from elsewhere by a name comprised of the name of the custom type and the name of the service connected by an underscore and prefixed as a whole word with storage_ . The stored data is wrapped in 8 container.øWhen reading of the custom object fails on the first service run, the service terminates the worker process by calling  with a corresponding message.)ngx-export-toolsName of the servicengx-export-tools Service mode*ngx-export-toolsName of the servicengx-export-toolsName of the custom typengx-export-tools Service mode+ngx-export-toolsName of the servicengx-export-toolsName of the custom typengx-export-tools Service mode &'()*+ &'()*+ (c) Alexey Radkov 2018-2023 BSD-stylealexey.radkov@gmail.comstable2non-portable (requires POSIX and Template Haskell) Safe-Inferred% #&'()*+ 9     !"#$%&'()*+,-./0123 456789:;<:;=:;>:;? @A7B9 CDEF GHIGHJ KL CMÎngx-export-tools-1.2.0-inplaceNgxExport.Tools.SimpleServiceNgxExport.Tools.SplitServiceNgxExport.Tools.CombinatorsNgxExport.Tools.SystemNgxExport.Tools.ReadNgxExport.Tools.TimeIntervalngx-export-toolsngxExportSimpleServiceTypedPersistentService Data.AesonFromJSONNgxExport.ToolsbaseForeign.C.TypesCUIntCInt splitServiceignitionServicedeferredService voidHandlerterminateWorkerProcessrestartWorkerProcessfinalizeHTTPRequestworkerProcessIsExiting ngxRequestPtrngxNowngxPidreadFromByteStringreadFromByteStringAsJSONreadFromByteStringWithRPtr readFromByteStringWithRPtrAsJSONskipRPtr$fFromByteStringReadableAsJSON$fFromByteStringReadable TimeIntervalHrMinSecHrMinMinSecUnsettoSecthreadDelaySec$fOrdTimeInterval$fEqTimeInterval$fFromJSONTimeInterval$fGenericTimeInterval$fLiftBoxedRepTimeInterval$fReadTimeInterval$fShowTimeInterval ServiceModeSingleShotServicengxExportSimpleService!ngxExportSimpleServiceTypedAsJSONbytestring-0.11.4.0Data.ByteString.Lazy.Internal ByteStringÓngx-export-1.7.7.1-4aad4068f9578f71c69b6e7d83c9cfbc96b2cc16742f6a01dc3287ba2e77ddfb NgxExportTerminateWorkerProcessRestartWorkerProcessFinalizeHTTPRequestWorkerProcessIsExitingGHC.ReadReadData.ByteString.Internal.Type GHC.MaybeNothingÎaeson-2.2.0.0-7778bc8faf3a50e858cc35600f2e073e738f3d593b150e217b0dc6d1c9ca69ccData.Aeson.Types.FromJSONghc-prim GHC.TypesBoolIO GHC.IORefIORefMaybe