Hoogle Search
Within LTS Haskell 24.50 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
takeAll :: ByteArray byteArray => Parser byteArray byteArraymemory Data.ByteArray.Parse Take the remaining bytes from the current position in the stream
setInstallShutdownHandler :: (IO () -> IO ()) -> Settings -> Settingswarp Network.Wai.Handler.Warp A code to install shutdown handler. For instance, this code should set up a UNIX signal handler. The handler should call the first argument, which closes the listen socket, at shutdown. Example usage:
settings :: IO () -> Settings settings shutdownAction = setInstallShutdownHandler shutdownHandler defaultSettings where shutdownHandler closeSocket = void $ installHandler sigTERM (Catch $ shutdownAction >> closeSocket) Nothing
Note that by default, the graceful shutdown mode lasts indefinitely (see setGracefulShutdownTimeout). If you install a signal handler as above, upon receiving that signal, the custom shutdown action will run and all outstanding requests will be handled. You may instead prefer to do one or both of the following:- Only wait a finite amount of time for outstanding requests to complete, using setGracefulShutdownTimeout.
- Only catch one signal, so the second hard-kills the Warp server, using CatchOnce.
connSendAll :: Connection -> ByteString -> IO ()warp Network.Wai.Handler.Warp.Internal The sending function.
settingsInstallShutdownHandler :: Settings -> IO () -> IO ()warp Network.Wai.Handler.Warp.Internal An action to install a handler (e.g. Unix signal handler) to close a listen socket. The first argument is an action to close the listen socket. Default: no action Since 3.0.1
forkFinally :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadIdbase-compat Control.Concurrent.Compat Fork a thread and call the supplied function when the thread is about to terminate, with an exception or a returned value. The function is called with asynchronous exceptions masked.
forkFinally action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
This function is useful for informing the parent when a child terminates, for example.groupAllWith :: Ord b => (a -> b) -> [a] -> [NonEmpty a]base-compat Data.List.NonEmpty.Compat groupAllWith operates like groupWith, but sorts the list first so that each equivalence class has, at most, one list in the output
groupAllWith1 :: Ord b => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a)base-compat Data.List.NonEmpty.Compat groupAllWith1 is to groupWith1 as groupAllWith is to groupWith
-
base-compat Data.Monoid.Compat No documentation available.
-
base-compat Data.Semigroup.Compat No documentation available.
mallocForeignPtr :: Storable a => IO (ForeignPtr a)base-compat Foreign.ForeignPtr.Safe.Compat Allocate some memory and return a ForeignPtr to it. The memory will be released automatically when the ForeignPtr is discarded. mallocForeignPtr is equivalent to
do { p <- malloc; newForeignPtr finalizerFree p }although it may be implemented differently internally: you may not assume that the memory returned by mallocForeignPtr has been allocated with malloc. GHC notes: mallocForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the ForeignPtr does not require a finalizer to free the memory. Use of mallocForeignPtr and associated functions is strongly recommended in preference to newForeignPtr with a finalizer.