Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Feb 23, 2024
1 parent d81db61 commit f0d73c2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/ecosystem/about_ecosystem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
We recommend adding token support to all your libraries where possible. If you have written such a project or added token support to an existing project, please let us know by writing an [issue](https://github.com/pomponchik/cantok/issues/new). If possible, information about the project will be added here.
13 changes: 13 additions & 0 deletions docs/ecosystem/projects/subprocess_management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To work with subprocesses, there is a [`suby`](https://github.com/pomponchik/suby) library with support for cancellation tokens. It has a very simple syntax:

```python
import suby

suby('python', '-c', 'print("hello, world!")')
```

A token can be passed as an argument:

```python
suby('python', '-c', 'import time; time.sleep(10_000)', token=TimeoutToken(1), catch_exceptions=True)
```
1 change: 0 additions & 1 deletion docs/ecosystem/subprocess_management.md

This file was deleted.

4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ nav:
- TimeoutToken: types_of_tokens/TimeoutToken.md
- CounterToken: types_of_tokens/CounterToken.md
- Ecosystem:
- Subprocess Management: ecosystem/subprocess_management.md
- About the ecosystem: ecosystem/about_ecosystem.md
- Projects:
- Subprocess Management: ecosystem/projects/subprocess_management.md
markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
Expand Down

0 comments on commit f0d73c2

Please sign in to comment.