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

Network.HTTP2.Internal

Synopsis

Thread Manager

data Manager Source #

Manager to manage the thread and the timer.

type Action = IO () Source #

Action to be spawned by the manager.

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.

setAction :: Manager -> Action -> IO () Source #

Setting the action to be spawned.

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

Stopping the manager.

spawnAction :: Manager -> IO () Source #

Spawning the action.

forkManaged :: Manager -> 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 -> ((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.