http2-5.3.4: HTTP/2 library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HTTP2.Internal

Synopsis

Thread Manager

data Manager Source #

Manager to manage the thread and the timer.

start :: Manager -> IO Manager Source #

Starting a thread manager. Its action is initially set to 'return ()' and should be set by setAction. This allows that the action can include the manager itself.

stopAfter :: Manager -> IO a -> (Maybe SomeException -> IO ()) -> IO a Source #

Stopping the manager.

The action is run in the scope of an exception handler that catches all exceptions (including asynchronous ones); this allows the cleanup handler to cleanup in all circumstances. If an exception is caught, it is rethrown after the cleanup is complete.

forkManaged :: Manager -> String -> IO () -> IO () Source #

Fork managed thread

This guarantees that the thread ID is added to the manager's queue before the thread starts, and is removed again when the thread terminates (normally or abnormally).

forkManagedUnmask :: Manager -> String -> ((forall x. IO x -> IO x) -> IO ()) -> IO () Source #

Like forkManaged, but run action with exceptions masked

timeoutKillThread :: Manager -> (Handle -> IO a) -> IO a Source #

Killing the IO action of the second argument on timeout.

timeoutClose :: Manager -> IO () -> IO (IO ()) Source #

Registering closer for a resource and returning a timer refresher.