summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-29 14:12:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-29 14:12:16 -0400
commitc79625290a9e17e8c9f6f0ed93a0e23a5ef0126c (patch)
treec975a1a2439f89c15feece0bdbe3a392851cafbe
parent0ed7db5f3ac87405f56eb27adb9fdaf42bc49125 (diff)
improving transfer data types and design
-rw-r--r--doc/design/assistant/syncing.mdwn26
1 files changed, 15 insertions, 11 deletions
diff --git a/doc/design/assistant/syncing.mdwn b/doc/design/assistant/syncing.mdwn
index 7c6ef16d3..02811f07e 100644
--- a/doc/design/assistant/syncing.mdwn
+++ b/doc/design/assistant/syncing.mdwn
@@ -48,20 +48,24 @@ anyway.
### transfer tracking
- data ToTransfer = ToUpload Key | ToDownload Key
- type ToTransferChan = TChan [ToTransfer]
-
-* ToUpload added by the watcher thread when it adds content.
-* ToDownload added by the watcher thread when it seens new symlinks
+* Upload added to queue by the watcher thread when it adds content.
+* Download added to queue by the watcher thread when it seens new symlinks
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.
+ (May sometimes want multiple threads downloading, or uploading, or even both.)
+
+ type TransferQueue = TChan [Transfer]
+ data Transfer = Upload Key Remote | Download Key Remote
data TransferID = TransferThread ThreadID | TransferProcess Pid
- data Direction = Uploading | Downloading
- data Transfer = Transfer Direction Key TransferID EpochTime Integer
- -- add [Transfer] to DaemonStatus
+ type AmountComplete = Integer
+ type StartedTime = EpochTime
+ 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
sending (triggered by another remote), so it can add data for those too.