multithreading - Threading and Dropbox -
i'm developing application might use dropbox it's storage.
my question is, can link folders between computers, more 1 person upload/download to/from same folder.
do have worry threading? happens if while person downloading file, other person updating same file. dropbox lock file while 1 operation being done on it? if not, guess have handle in application correct?
yes, have worry this.
dropbox uses optimistic concurrency. every file has rev
(revision) can reference when uploading file (e.g. via /files_put
). basic idea when download file, keep track of rev
, , when upload file, pass rev
parent_rev
parameter. if file has been changed in meantime different user (via shared folder) or same user (via different device), rev
won't match. happens dictated autorename
parameter. if specify true
, file renamed on conflict. if specify false
, upload fail altogether, , app can decide do.
essentially, can't stop users updating files simultaneously on multiple devices, can (and should) deal these conflicts in app, , rev
lets ensure no data lost.
Comments
Post a Comment