Skip to content

asynchronous process support with coroutine

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Xudong-Huang/may_process

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

may_process

A library for working with processes.

This crate provides a Command type that is compatible with the standard library's std::process::Command except that it can run in coroutine context without blocking the thread execution. When running in thread context it's the same as using std::process::Command.

Build Status Build status

Documentation

Usage

First, add this to your Cargo.toml:

[dependencies]
may_process = "0.1"

Next you can use the API directly:

#[macro_use]
extern crate may;
extern crate may_process;

use may_process::Command;

fn main() {
    join!(
        {
            let ret = Command::new("sh").args(&["-c", "echo hello"]).status();
            assert_eq!(ret.is_ok(), true);
            let exit_status = ret.unwrap();
            assert_eq!(exit_status.success(), true);
            assert_eq!(exit_status.code(), Some(0));
        },
        {
            let ret = Command::new("sh").args(&["-c", "echo may"]).status();
            assert_eq!(ret.is_ok(), true);
            let exit_status = ret.unwrap();
            assert_eq!(exit_status.success(), true);
            assert_eq!(exit_status.code(), Some(0));
        }
    );
}

License

This project is licensed under either of

at your option.

About

asynchronous process support with coroutine

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages