10 #ifndef DAQ_PROCESS_RSYNC_ASYNC_PROCESS_HPP
11 #define DAQ_PROCESS_RSYNC_ASYNC_PROCESS_HPP
19 #include <boost/signals2/signal.hpp>
32 std::optional<std::string>
rsync;
49 std::optional<std::chrono::seconds>
timeout;
91 virtual boost::signals2::connection
ConnectProgress(SigProgress::slot_type
const& slot) = 0;
148 [[nodiscard]] boost::future<int>
Initiate()
override;
153 boost::signals2::connection
ConnectProgress(SigProgress::slot_type
const& slot)
override;
daq::AsyncProcess class definition
Interface to asynchronous process.
Represents a subprocess as an asynchronous operation.
More specialized version for rsync which also monitors transfer progress.
virtual ~RsyncAsyncProcessIf()
virtual boost::signals2::connection ConnectProgress(SigProgress::slot_type const &slot)=0
Connect to progress signal.
boost::signals2::signal< void(pid_t, RsyncProgress const &)> SigProgress
Progress update signal.
Represents an rsync process as an asynchronous operation.
boost::future< int > Initiate() override
Progress update signal.
RsyncAsyncProcess(boost::asio::io_context &ctx, std::string source, std::string dest, RsyncOptions const &opts={}, DryRun flag=DryRun::Disabled)
Construct async operation.
virtual ~RsyncAsyncProcess()
boost::signals2::connection ConnectProgress(SigProgress::slot_type const &slot) override
Connect to progress signal.
std::optional< std::string > rsync
Binary to use.
std::optional< std::chrono::seconds > timeout
I/O timeout.
std::optional< bool > inplace
–inplace/–no-inplace
std::optional< bool > whole_file
Transfer with/without delta xfer algorithm.
std::chrono::seconds remaining
Estimated remaining time.
std::optional< RsyncProgress > ParseRsyncProgress(std::string const &line) noexcept
Parse progress update from rsync.
float progress
Progress as fraction of 1 (complete == 1.0)
uint64_t transferred
Number of transferred bytes.
float speed
Transfer speed in bytes/sec.
std::optional< unsigned > bw_limit
Enables rate-limiting in kb/s.
Options controlling rsync invocation.
Describes file transfer progress,.