@@ -92,9 +92,6 @@ async def publish(self, data: str) -> None:
92
92
93
93
Args:
94
94
data: The data string to publish to all subscribers.
95
-
96
- Returns:
97
- None
98
95
"""
99
96
dead : List [asyncio .Queue [str ]] = []
100
97
for q in self ._subscribers :
@@ -121,9 +118,6 @@ def unsubscribe(self, q: "asyncio.Queue[str]") -> None:
121
118
122
119
Args:
123
120
q: The queue to unsubscribe from published data.
124
-
125
- Returns:
126
- None
127
121
"""
128
122
with suppress (ValueError ):
129
123
self ._subscribers .remove (q )
@@ -146,12 +140,6 @@ async def start(self) -> None:
146
140
"""Start the stdio subprocess.
147
141
148
142
Creates the subprocess and starts the stdout pump task.
149
-
150
- Returns:
151
- None
152
-
153
- Raises:
154
- OSError: If the subprocess cannot be started.
155
143
"""
156
144
LOGGER .info ("Starting stdio subprocess: %s" , self ._cmd )
157
145
self ._proc = await asyncio .create_subprocess_exec (
@@ -168,9 +156,6 @@ async def stop(self) -> None:
168
156
"""Stop the stdio subprocess.
169
157
170
158
Terminates the subprocess and cancels the pump task.
171
-
172
- Returns:
173
- None
174
159
"""
175
160
if self ._proc is None :
176
161
return
@@ -187,9 +172,6 @@ async def send(self, raw: str) -> None:
187
172
Args:
188
173
raw: The raw data string to send to the subprocess.
189
174
190
- Returns:
191
- None
192
-
193
175
Raises:
194
176
RuntimeError: If the stdio endpoint is not started.
195
177
"""
@@ -205,11 +187,8 @@ async def _pump_stdout(self) -> None:
205
187
Continuously reads lines from the subprocess stdout and publishes them
206
188
to the pubsub system.
207
189
208
- Returns:
209
- None
210
-
211
190
Raises:
212
- Exception : If the stdout pump encounters an error .
191
+ asyncio.CancelledError : If the pump task is cancelled .
213
192
"""
214
193
assert self ._proc and self ._proc .stdout
215
194
reader = self ._proc .stdout
@@ -225,7 +204,6 @@ async def _pump_stdout(self) -> None:
225
204
raise
226
205
except Exception : # pragma: no cover --best-effort logging
227
206
LOGGER .exception ("stdout pump crashed - terminating bridge" )
228
- raise
229
207
230
208
231
209
# ---------------------------------------------------------------------------#
@@ -419,9 +397,6 @@ async def _run_stdio_to_sse(cmd: str, port: int, log_level: str = "info", cors:
419
397
port: The port to bind the HTTP server to.
420
398
log_level: The logging level to use. Defaults to "info".
421
399
cors: Optional list of CORS allowed origins.
422
-
423
- Returns:
424
- None
425
400
"""
426
401
pubsub = _PubSub ()
427
402
stdio = StdIOEndpoint (cmd , pubsub )
@@ -464,9 +439,6 @@ async def _run_sse_to_stdio(url: str, oauth2_bearer: Optional[str]) -> None:
464
439
url: The SSE endpoint URL to connect to.
465
440
oauth2_bearer: Optional OAuth2 bearer token for authentication.
466
441
467
- Returns:
468
- None
469
-
470
442
Raises:
471
443
ImportError: If httpx package is not available.
472
444
"""
@@ -516,7 +488,7 @@ def start_stdio(cmd, port, log_level, cors):
516
488
cors: Optional list of CORS allowed origins.
517
489
518
490
Returns:
519
- None
491
+ None: This function does not return a value.
520
492
"""
521
493
return asyncio .run (_run_stdio_to_sse (cmd , port , log_level , cors ))
522
494
@@ -529,7 +501,7 @@ def start_sse(url, bearer):
529
501
bearer: Optional OAuth2 bearer token for authentication.
530
502
531
503
Returns:
532
- None
504
+ None: This function does not return a value.
533
505
"""
534
506
return asyncio .run (_run_sse_to_stdio (url , bearer ))
535
507
@@ -539,13 +511,6 @@ def main(argv: Optional[Sequence[str]] | None = None) -> None:
539
511
540
512
Args:
541
513
argv: Optional sequence of command line arguments. If None, uses sys.argv[1:].
542
-
543
- Returns:
544
- None
545
-
546
- Raises:
547
- NotImplementedError: If an unsupported option is specified.
548
- KeyboardInterrupt: If the user interrupts the process.
549
514
"""
550
515
args = _parse_args (argv or sys .argv [1 :])
551
516
logging .basicConfig (
0 commit comments