Skip to content

Commit

Permalink
Update WorkerThread.hs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
  • Loading branch information
soulomoon and michaelpj authored Jun 8, 2024
1 parent 027e5be commit 99322fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ghcide/src/Development/IDE/Core/WorkerThread.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ import Control.Monad.Cont (ContT (ContT))
-- * `blockRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.


-- | withWorkerQueue creates a new TQueue and runs the workerAction in a separate thread.
-- | 'withWorkerQueue' creates a new 'TQueue', and launches a worker
-- thread which polls the queue for requests and runs the given worker
-- function on them.
withWorkerQueue :: (t -> IO a) -> ContT () IO (TQueue t)
withWorkerQueue workerAction = ContT $ \mainAction -> do
q <- newTQueueIO
Expand Down

0 comments on commit 99322fa

Please sign in to comment.