File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
crates/rmcp/src/transport Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -66,16 +66,25 @@ impl AsyncRead for TokioChildProcessOut {
66
66
}
67
67
68
68
impl TokioChildProcess {
69
+ /// Create a new Tokio child process with the given command.
70
+ ///
71
+ /// # Manage the child process
72
+ /// You can also check these issue and pr for more information on how to manage the child process:
73
+ /// - [#156](https://github.com/modelcontextprotocol/rust-sdk/pull/156)
74
+ /// - [#253](https://github.com/modelcontextprotocol/rust-sdk/issues/253)
75
+ /// ```rust,ignore
76
+ /// #[cfg(unix)]
77
+ /// command_wrap.wrap(process_wrap::tokio::ProcessGroup::leader());
78
+ /// #[cfg(windows)]
79
+ /// command_wrap.wrap(process_wrap::tokio::JobObject);
80
+ /// ```
81
+ ///
69
82
pub fn new ( command : impl Into < TokioCommandWrap > ) -> std:: io:: Result < Self > {
70
83
let mut command_wrap = command. into ( ) ;
71
84
command_wrap
72
85
. command_mut ( )
73
86
. stdin ( std:: process:: Stdio :: piped ( ) )
74
87
. stdout ( std:: process:: Stdio :: piped ( ) ) ;
75
- #[ cfg( unix) ]
76
- command_wrap. wrap ( process_wrap:: tokio:: ProcessGroup :: leader ( ) ) ;
77
- #[ cfg( windows) ]
78
- command_wrap. wrap ( process_wrap:: tokio:: JobObject ) ;
79
88
let ( child, ( child_stdout, child_stdin) ) = child_process ( command_wrap. spawn ( ) ?) ?;
80
89
Ok ( Self {
81
90
child : ChildWithCleanup { inner : child } ,
You can’t perform that action at this time.
0 commit comments