finish message serialization of progress meters
Any given transfer can only display 1 progress meter at a time, or so this code assumes. In some cases, there are progress meters for different stages of a transfer, perhaps, and that is supported by this. This commit was sponsored by Ethan Aubin.
This commit is contained in:
parent
4efecaebd6
commit
31e417f351
7 changed files with 91 additions and 33 deletions
|
@ -11,6 +11,7 @@ import Assistant.Common
|
|||
import Assistant.Types.TransferrerPool
|
||||
import Types.Transfer
|
||||
import Utility.Batch
|
||||
import Messages.Serialized
|
||||
|
||||
import qualified Command.TransferKeys as T
|
||||
|
||||
|
@ -58,14 +59,9 @@ checkTransferrerPoolItem program batchmaker i = case i of
|
|||
performTransfer :: Transferrer -> Transfer -> TransferInfo -> Assistant Bool
|
||||
performTransfer transferrer t info = catchBoolIO $ do
|
||||
(liftIO $ T.sendRequest t info (transferrerWrite transferrer))
|
||||
readresponse
|
||||
where
|
||||
readresponse =
|
||||
liftIO (T.readResponse (transferrerRead transferrer)) >>= \case
|
||||
Right r -> return r
|
||||
Left so -> do
|
||||
liftAnnex $ emitSerializedOutput so
|
||||
readresponse
|
||||
relaySerializedOutput
|
||||
(liftIO (T.readResponse (transferrerRead transferrer)))
|
||||
liftAnnex
|
||||
|
||||
{- Starts a new git-annex transferkeys process, setting up handles
|
||||
- that will be used to communicate with it. -}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue