@@ -59,13 +59,13 @@ def remote_future(self,
5959 need_response : bool = True ) -> concurrent .futures .Future :
6060 """Remote call that returns a Future object."""
6161 return self ._prepare_and_call (timeout , need_response , "future" ,
62- "call_future " )
62+ "_call_future " )
6363
6464 def remote_streaming (self ,
6565 timeout : Optional [float ] = None ) -> AsyncIterator [Any ]:
6666 """Remote call for streaming results."""
6767 # Streaming always needs a response
68- return self ._prepare_and_call (timeout , True , "async" , "call_streaming " )
68+ return self ._prepare_and_call (timeout , True , "async" , "_call_streaming " )
6969
7070
7171class RPCClient :
@@ -365,27 +365,8 @@ def _call_sync(self, method_name, *args, **kwargs):
365365 f"RPC Client _call_sync: Got result for { method_name } : { result } " )
366366 return result
367367
368- def call_async (self , name : str , * args , ** kwargs ) -> Any :
369- """
370- Call a remote method asynchronously.
371-
372- Args:
373- name: Method name to call
374- *args: Positional arguments
375- **kwargs: Keyword arguments
376-
377- Returns:
378- Coroutine that can be awaited
379-
380- Example:
381- result = await client.call_async('remote_method', arg1, arg2, key=value)
382- """
383- if "__rpc_params" not in kwargs :
384- kwargs ["__rpc_params" ] = RPCParams (need_response = True )
385- return self ._call_async (name , * args , ** kwargs )
386-
387- def call_future (self , name : str , * args ,
388- ** kwargs ) -> concurrent .futures .Future :
368+ def _call_future (self , name : str , * args ,
369+ ** kwargs ) -> concurrent .futures .Future :
389370 """
390371 Call a remote method and return a Future.
391372
@@ -396,12 +377,6 @@ def call_future(self, name: str, *args,
396377
397378 Returns:
398379 A Future object that can be used to retrieve the result
399-
400- Example:
401- future = client.call_future('remote_method', arg1, arg2, key=value)
402- result = future.result() # blocks until complete
403- # or
404- future.add_done_callback(lambda f: print(f.result()))
405380 """
406381
407382 def _async_to_sync ():
@@ -412,25 +387,8 @@ def _async_to_sync():
412387
413388 return self ._executor .submit (_async_to_sync )
414389
415- def call_sync (self , name : str , * args , ** kwargs ) -> Any :
416- """
417- Call a remote method synchronously (blocking).
418-
419- Args:
420- name: Method name to call
421- *args: Positional arguments
422- **kwargs: Keyword arguments
423-
424- Returns:
425- The result of the remote method call
426-
427- Example:
428- result = client.call_sync('remote_method', arg1, arg2, key=value)
429- """
430- return self ._call_sync (name , * args , ** kwargs )
431-
432- async def call_streaming (self , name : str , * args ,
433- ** kwargs ) -> AsyncIterator [Any ]:
390+ async def _call_streaming (self , name : str , * args ,
391+ ** kwargs ) -> AsyncIterator [Any ]:
434392 """
435393 Call a remote async generator method and get streaming results.
436394
@@ -441,10 +399,6 @@ async def call_streaming(self, name: str, *args,
441399
442400 Yields:
443401 Results from the remote async generator
444-
445- Example:
446- async for result in client.call_streaming('streaming_task'):
447- print(result)
448402 """
449403 if self ._server_stopped :
450404 raise RPCCancelled ("Server is shutting down, request cancelled" )
@@ -474,7 +428,7 @@ async def call_streaming(self, name: str, *args,
474428
475429 # Read streaming responses
476430 while True :
477- logger_debug (f"RPC Client call_streaming waiting for response" ,
431+ logger_debug (f"RPC Client _call_streaming waiting for response" ,
478432 color = "green" )
479433 if timeout is None :
480434 response = await queue .get ()
@@ -483,14 +437,14 @@ async def call_streaming(self, name: str, *args,
483437 timeout = timeout )
484438
485439 logger_debug (
486- f"RPC Client call_streaming received [{ response .stream_status } ] response: { response } " ,
440+ f"RPC Client _call_streaming received [{ response .stream_status } ] response: { response } " ,
487441 color = "green" )
488442 if response .stream_status == 'start' :
489443 # Start of stream
490444 continue
491445 elif response .stream_status == 'data' :
492446 logger_debug (
493- f"RPC Client call_streaming received data: { response .result } " ,
447+ f"RPC Client _call_streaming received data: { response .result } " ,
494448 color = "green" )
495449 yield response .result
496450 elif response .stream_status == 'end' :
0 commit comments