improving transfer data types and design

This commit is contained in:
Joey Hess 2012-06-29 14:12:16 -04:00
parent 0ed7db5f3a
commit c79625290a

View file

@ -48,20 +48,24 @@ anyway.
### transfer tracking ### transfer tracking
data ToTransfer = ToUpload Key | ToDownload Key * Upload added to queue by the watcher thread when it adds content.
type ToTransferChan = TChan [ToTransfer] * Download added to queue by the watcher thread when it seens new symlinks
* ToUpload added by the watcher thread when it adds content.
* ToDownload added by the watcher thread when it seens new symlinks
that lack content. that lack content.
* Transfer threads started/stopped as necessary to move data.
(May sometimes want multiple threads downloading, or uploading, or even both.)
Transfer threads started/stopped as necessary to move data. type TransferQueue = TChan [Transfer]
May sometimes want multiple threads downloading, or uploading, or even both. data Transfer = Upload Key Remote | Download Key Remote
data TransferID = TransferThread ThreadID | TransferProcess Pid data TransferID = TransferThread ThreadID | TransferProcess Pid
data Direction = Uploading | Downloading type AmountComplete = Integer
data Transfer = Transfer Direction Key TransferID EpochTime Integer type StartedTime = EpochTime
-- add [Transfer] to DaemonStatus data TransferInfo = TransferInfo TransferID StartedTime AmountComplete
-- add (M.Map Transfer TransferInfo) to DaemonStatus
startTransfer :: Transfer -> Annex TransferID
stopTransfer :: TransferID -> IO ()
The assistant needs to find out when `git-annex-shell` is receiving or The assistant needs to find out when `git-annex-shell` is receiving or
sending (triggered by another remote), so it can add data for those too. sending (triggered by another remote), so it can add data for those too.