Assistant monad, stage 3
All toplevel named threads are converted to the Assistant monad. Some utility functions still need to be converted.
This commit is contained in:
parent
1df7417403
commit
67ce7929a5
7 changed files with 174 additions and 182 deletions
|
@ -129,14 +129,12 @@ startTransfer t = do
|
|||
(\i -> i { transferPaused = False })
|
||||
dstatus
|
||||
throwTo tid ResumeTransfer
|
||||
start info = do
|
||||
st <- getAssistantY threadState
|
||||
dstatus <- getAssistantY daemonStatusHandle
|
||||
slots <- getAssistantY transferSlots
|
||||
commitchan <- getAssistantY commitChan
|
||||
liftIO $ inImmediateTransferSlot dstatus slots $ do
|
||||
program <- readProgramFile
|
||||
Transferrer.startTransfer st dstatus commitchan program t info
|
||||
start info = runAssistantY $ do
|
||||
program <- liftIO readProgramFile
|
||||
dstatus <- getAssistant daemonStatusHandle
|
||||
slots <- getAssistant transferSlots
|
||||
inImmediateTransferSlot dstatus slots <~>
|
||||
Transferrer.startTransfer program t info
|
||||
|
||||
getCurrentTransfers :: Handler TransferMap
|
||||
getCurrentTransfers = currentTransfers <$> getDaemonStatusY
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue