Skip to content

Commit c832da3

Browse files
committed
use block comment
1 parent a16d04a commit c832da3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

ghcide/src/Development/IDE/Core/WorkerThread.hs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ import Control.Concurrent.Strict (newBarrier, signalBarrier,
99
import Control.Monad (forever)
1010
import Control.Monad.Cont (ContT (ContT))
1111

12-
-- Note [Serializing runs in separate thread]
13-
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14-
-- We often want to take long-running actions using some resource that cannot be shared.
15-
-- In this instance it is useful to have a queue of jobs to run using the resource.
16-
-- Like the db writes, session loading in session loader, shake session restarts.
17-
--
18-
-- Originally we used various ways to implement this, but it was hard to maintain and error prone.
19-
-- Moreover, we can not stop these threads uniformly when we are shutting down the server.
20-
--
21-
-- `Development.IDE.Core.WorkerThread` module provides a simple api to implement this easily.
22-
-- * `withWorkerQueue`: accepts an action to run in separate thread and returns a `TQueue` to send the actions to run.
23-
-- * `awaitRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.
12+
{-
13+
Note [Serializing runs in separate thread]
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
We often want to take long-running actions using some resource that cannot be shared.
16+
In this instance it is useful to have a queue of jobs to run using the resource.
17+
Like the db writes, session loading in session loader, shake session restarts.
2418
19+
Originally we used various ways to implement this, but it was hard to maintain and error prone.
20+
Moreover, we can not stop these threads uniformly when we are shutting down the server.
21+
22+
`Development.IDE.Core.WorkerThread` module provides a simple api to implement this easily.
23+
* `withWorkerQueue`: accepts an action to run in separate thread and returns a `TQueue` to send the actions to run.
24+
* `awaitRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.
25+
-}
2526

2627
-- | withWorkerQueue creates a new TQueue and runs the workerAction in a separate thread.
2728
withWorkerQueue :: (t -> IO a) -> ContT () IO (TQueue t)

0 commit comments

Comments
 (0)