pub struct TokioCommandRunner;Expand description
Default CommandRunner that uses tokio::process::Command.
On Unix the child is launched in its own process group via
setpgid(0, 0). pg_dump --jobs N forks worker processes that share
the leader’s pgid, so on cancellation we deliver SIGTERM to the
whole group (kill(-pgid, SIGTERM)) and escalate to SIGKILL
after a short grace window. Without this, killing only the leader
leaves the workers re-parented to PID 1 and still pumping bytes from
the source. kill_on_drop is also set so a cancelled future never
leaks even if the explicit kill path takes the slow road.
Trait Implementations§
Source§impl Clone for TokioCommandRunner
impl Clone for TokioCommandRunner
Source§fn clone(&self) -> TokioCommandRunner
fn clone(&self) -> TokioCommandRunner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CommandRunner for TokioCommandRunner
impl CommandRunner for TokioCommandRunner
Source§fn run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
program: &'life1 str,
args: &'life2 [String],
env: &'life3 [(String, String)],
cancel: &'life4 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
program: &'life1 str,
args: &'life2 [String],
env: &'life3 [(String, String)],
cancel: &'life4 CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Run
program with args and the given environment additions. Should
fail if the process exits with a non-zero status, or return
MigrationError::Cancelled if cancel fires before the child
exits.Source§impl Debug for TokioCommandRunner
impl Debug for TokioCommandRunner
Source§impl Default for TokioCommandRunner
impl Default for TokioCommandRunner
Source§fn default() -> TokioCommandRunner
fn default() -> TokioCommandRunner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TokioCommandRunner
impl RefUnwindSafe for TokioCommandRunner
impl Send for TokioCommandRunner
impl Sync for TokioCommandRunner
impl Unpin for TokioCommandRunner
impl UnsafeUnpin for TokioCommandRunner
impl UnwindSafe for TokioCommandRunner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more