This repository was archived by the owner on Oct 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -113,13 +113,20 @@ fresh data is generated when first requested.
113
113
## Dispatcher and messaging
114
114
115
115
``` haskell
116
- dispatcherP :: forall m . TChan (PluginRequest m )
117
- -> IdePlugins
118
- -> GM. Options
119
- -> DispatcherEnv
120
- -> ErrorHandler
121
- -> CallbackHandler m
122
- -> IO ()
116
+ runScheduler
117
+ :: forall m
118
+ . Scheduler m
119
+ -> ErrorHandler
120
+ -> CallbackHandler m
121
+ -> C. ClientCapabilities
122
+ -> IO ()
123
+
124
+ sendRequest
125
+ :: forall m
126
+ . Scheduler m
127
+ -> Maybe DocUpdate
128
+ -> PluginRequest m
129
+ -> IO ()
123
130
124
131
type PluginRequest m = Either (IdeRequest m ) (GhcRequest m )
125
132
@@ -139,8 +146,8 @@ data IdeRequest m = forall a. IdeRequest
139
146
140
147
```
141
148
142
- `dispatcherP ` (thread # 3 ) listens for ` PluginRequest `s on the ` TChan ` and executes the
143
- `pinReq` , sending the result to the `pinCallback` . `pinDocVer` and `pinLspReqId` help us
149
+ `runScheduler ` (thread # 3 ) waits for requests sent through `sendRequest ` and executes the
150
+ `pinReq` . Sending the result to the `pinCallback` . `pinDocVer` and `pinLspReqId` help us
144
151
make sure we don't execute a stale request or a request that has been cancelled by the IDE .
145
152
Note that because of the single threaded architecture, we can't cancel a request that
146
153
has already started execution.
You can’t perform that action at this time.
0 commit comments