tokio-process-bits

Crates.iotokio-process-bits
lib.rstokio-process-bits
version0.1.4
sourcesrc
created_at2017-12-26 20:09:09.496259
updated_at2017-12-29 15:24:32.229947
descriptionA collection of modules useful when developing Tokio based applications that spawn child processes.
homepagehttps://github.com/algermissen/tokio-bits
repositoryhttps://github.com/algermissen/tokio-bits
max_upload_size
id44481
size15,592
Jan Algermissen (algermissen)

documentation

https://docs.rs/tokio-process-bits

README

tokio-process-bits

Exploring tokio-process async pipes io

This example shows how to read child processes stdout as streams of lines in an async fashion.

Running the example will produce something like this:

$ cargo run --example simple

LINE: [CHILD 88187] PING 127.0.0.1 (127.0.0.1): 56 data bytes
LINE: [CHILD 88187] 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.123 ms
LINE: [CHILD 88187] 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.110 ms
LINE: [CHILD 88188] PING 0.0.0.0 (0.0.0.0): 56 data bytes
LINE: [CHILD 88188] Request timeout for icmp_seq 0
LINE: [CHILD 88188] Request timeout for icmp_seq 1
LINE: [CHILD 88187] 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.113 ms

I mostly built this to explore async reading of child stdout so I can run such child processes from single-threaded Web services. That is: I want to serve Web requets while reading child stdout.

Commit count: 14

cargo fmt