Skip to content

Commit

Permalink
Expose blocking threads option to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Jan 21, 2024
1 parent 0ab01fc commit 59c6996
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ Options:
GRANIAN_WORKERS; default: 1; x>=1]
--threads INTEGER RANGE Number of threads [env var:
GRANIAN_THREADS; default: 1; x>=1]
--blocking-threads INTEGER RANGE
Number of blocking threads [env var:
GRANIAN_BLOCKING_THREADS; default: 1; x>=1]
--threading-mode [runtime|workers]
Threading mode to use [env var:
GRANIAN_THREADING_MODE; default: workers]
Expand Down
3 changes: 2 additions & 1 deletion granian/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def main(
websockets: bool = typer.Option(True, '--ws/--no-ws', help='Enable websockets handling', show_default='enabled'),
workers: int = typer.Option(1, min=1, help='Number of worker processes'),
threads: int = typer.Option(1, min=1, help='Number of threads'),
blocking_threads: int = typer.Option(1, min=1, help='Number of blocking threads'),
threading_mode: ThreadModes = typer.Option(ThreadModes.workers.value, help='Threading mode to use'),
loop: Loops = typer.Option(Loops.auto.value, help='Event loop implementation'),
loop_opt: bool = typer.Option(False, '--opt/--no-opt', help='Enable loop optimizations', show_default='disabled'),
Expand Down Expand Up @@ -130,7 +131,7 @@ def main(
interface=interface,
workers=workers,
threads=threads,
pthreads=threads,
pthreads=blocking_threads,
threading_mode=threading_mode,
loop=loop,
loop_opt=loop_opt,
Expand Down

0 comments on commit 59c6996

Please sign in to comment.