@@ -30,7 +30,6 @@ pub struct Channel {
3030#[ uniffi:: export]
3131impl Channel {
3232 /// Create a new RPC channel
33- /// Make a unary-to-unary RPC call (blocking version)
3433 ///
3534 /// # Arguments
3635 /// * `app` - The SLIM application instance
@@ -40,9 +39,31 @@ impl Channel {
4039 /// A new channel instance
4140 #[ uniffi:: constructor]
4241 pub fn new ( app : Arc < App > , remote : Arc < Name > ) -> Arc < Self > {
42+ Self :: new_with_connection ( app, remote, None )
43+ }
44+
45+ /// Create a new RPC channel with optional connection ID
46+ ///
47+ /// The connection ID is used to set up routing before making RPC calls,
48+ /// enabling multi-hop RPC calls through specific connections.
49+ ///
50+ /// # Arguments
51+ /// * `app` - The SLIM application instance
52+ /// * `remote` - The remote service name to connect to
53+ /// * `connection_id` - Optional connection ID for routing setup
54+ ///
55+ /// # Returns
56+ /// A new channel instance
57+ #[ uniffi:: constructor]
58+ pub fn new_with_connection (
59+ app : Arc < App > ,
60+ remote : Arc < Name > ,
61+ connection_id : Option < u64 > ,
62+ ) -> Arc < Self > {
4363 let slim_name = remote. as_ref ( ) . clone ( ) . into ( ) ;
4464 let runtime = crate :: get_runtime ( ) . handle ( ) . clone ( ) ;
45- let inner = CoreChannel :: new_with_connection ( app. inner ( ) , slim_name, None , Some ( runtime) ) ;
65+ let inner =
66+ CoreChannel :: new_with_connection ( app. inner ( ) , slim_name, connection_id, Some ( runtime) ) ;
4667
4768 Arc :: new ( Self { inner } )
4869 }
0 commit comments