Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A variant of Pipes.Concurrent that uses a Finger Tree-based Priority
Queue (TPQueue
) instead of a normal TQueue
.
Documentation
withSpawn :: Ord p => ((Output (p, a), Input a) -> IO r) -> IO r Source #
withSpawn
passes its enclosed action an Output
and Input
like you'd
get from spawn
, but automatically seal
s them after the action completes.
This can be used when you need the seal
ing behavior available from spawn
,
but want to work at a bit higher level:
withSpawn buffer $ \(output, input) -> ...
withSpawn
is exception-safe, since it uses bracket
internally.