ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Represents an rsync process as an asynchronous operation. More...
#include <rsyncAsyncProcess.hpp>
Public Member Functions | |
virtual | ~RsyncAsyncProcess () |
RsyncAsyncProcess (boost::asio::io_context &ctx, std::string source, std::string dest, RsyncOptions const &opts={}, DryRun flag=DryRun::Disabled) | |
Construct async operation. More... | |
Public Member Functions inherited from daq::RsyncAsyncProcessIf | |
virtual | ~RsyncAsyncProcessIf () |
Public Member Functions inherited from daq::AsyncProcessIf | |
virtual | ~AsyncProcessIf () |
Public Member Functions inherited from daq::AsyncProcess | |
AsyncProcess (boost::asio::io_context &ctx, std::vector< std::string > args) | |
Constructor. More... | |
virtual | ~AsyncProcess () noexcept |
std::optional< pid_t > | GetPid () const noexcept override |
Get PID. More... | |
std::error_code | Abort () noexcept override |
Aborts the operation by terminating process which completes the operation. More... | |
std::error_code | Signal (int sig) noexcept override |
Send signal to process. More... | |
bool | IsRunning () const noexcept override |
std::vector< std::string > const & | GetArguments () const noexcept override |
boost::signals2::connection | ConnectStdout (SigOutStream::slot_type const &slot) override |
Signal type for stdout/stderr signals. More... | |
boost::signals2::connection | ConnectStderr (SigOutStream::slot_type const &slot) override |
Signal type for stdout/stderr signals. More... | |
Signals | |
using | SigProgress = RsyncAsyncProcessIf::SigProgress |
Progress update signal. More... | |
boost::future< int > | Initiate () override |
Progress update signal. More... | |
boost::signals2::connection | ConnectProgress (SigProgress::slot_type const &slot) override |
Connect to progress signal. More... | |
Additional Inherited Members | |
Public Types inherited from daq::RsyncAsyncProcessIf | |
enum | DryRun { DryRun::Disabled = 0, DryRun::Enabled } |
using | SigProgress = boost::signals2::signal< void(pid_t, RsyncProgress const &)> |
Progress update signal. More... | |
Public Types inherited from daq::AsyncProcessIf | |
using | SigOutStream = boost::signals2::signal< void(pid_t, std::string const &)> |
Signal type for stdout/stderr signals. More... | |
Public Types inherited from daq::AsyncProcess | |
using | SigOutStream = boost::signals2::signal< void(pid_t, std::string const &)> |
Signal type for stdout/stderr signals. More... | |
Represents an rsync process as an asynchronous operation.
Once constructed the operation is initiated (only once) with Initiate()
which starts the process and returns a boost::future object that will receive exit code when process terminates and all output has been read.
Operation can be aborted with Abort()
which will terminate process and set future with exceptional result.
Definition at line 116 of file rsyncAsyncProcess.hpp.
Progress update signal.
Definition at line 146 of file rsyncAsyncProcess.hpp.
|
virtual |
Definition at line 115 of file rsyncAsyncProcess.cpp.
daq::RsyncAsyncProcess::RsyncAsyncProcess | ( | boost::asio::io_context & | ctx, |
std::string | source, | ||
std::string | dest, | ||
RsyncOptions const & | opts = {} , |
||
DryRun | flag = DryRun::Disabled |
||
) |
Construct async operation.
ctx | io_context instance to use. |
source | rsync file source. |
dest | rsync file dest. |
opts | rsync options. |
flag | Control whether rsync should do a dry-run (useful to test if connection is possible). |
Definition at line 107 of file rsyncAsyncProcess.cpp.
|
overridevirtual |
Connect to progress signal.
Implements daq::RsyncAsyncProcessIf.
Definition at line 129 of file rsyncAsyncProcess.cpp.
|
overridevirtual |
Progress update signal.
Reimplemented from daq::AsyncProcess.
Definition at line 118 of file rsyncAsyncProcess.cpp.