]> git.proxmox.com Git - proxmox-backup.git/commit
asyncify pxar create_archive
authorStefan Reiter <s.reiter@proxmox.com>
Tue, 9 Feb 2021 12:03:48 +0000 (13:03 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 17 Feb 2021 08:24:20 +0000 (09:24 +0100)
commit6afb60abf5572e94d5d6d5e30c9857bb175838ce
treeb2eab5e6d8cb17be9c7862e96446d8011bcd4104
parenta42212fc1e3e4532fe83a167eb7a2da7634eba9c
asyncify pxar create_archive

...to take advantage of the aio::Encoder from the pxar create.

Rather straightforward conversion, but does require getting rid of
references in the Archiver struct, and thus has to be given the Mutex
for the catalog directly. The callback is boxed.

archive_dir_contents can call itself recursively, and thus needs to
return a boxed future.

Users are adjusted, namely PxarBackupStream is converted to use an
Abortable future instead of a thread so it supports async in its handler
function, and the pxar bin create_archive is converted to an async API
function. One test case is made to just use 'block_on'.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/bin/pxar.rs
src/client/pxar_backup_stream.rs
src/pxar/create.rs
tests/catar.rs