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 {
6666}
6767
6868impl 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+ ///
6982 pub fn new ( command : impl Into < TokioCommandWrap > ) -> std:: io:: Result < Self > {
7083 let mut command_wrap = command. into ( ) ;
7184 command_wrap
7285 . command_mut ( )
7386 . stdin ( std:: process:: Stdio :: piped ( ) )
7487 . 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 ) ;
7988 let ( child, ( child_stdout, child_stdin) ) = child_process ( command_wrap. spawn ( ) ?) ?;
8089 Ok ( Self {
8190 child : ChildWithCleanup { inner : child } ,
You can’t perform that action at this time.
0 commit comments