minor package and README updates

This commit is contained in:
Sam G. 2024-05-17 03:56:22 -07:00
parent 54327432fa
commit d60250eb8b
4 changed files with 29 additions and 8 deletions

View File

@ -3,6 +3,8 @@
simple event-based model over core Python utilities like `ThreadPoolExecutor` to simple event-based model over core Python utilities like `ThreadPoolExecutor` to
facilitate reactivity and manage concurrent responses. facilitate reactivity and manage concurrent responses.
![High-level execution flow diagram](docs/_static/execlib.png)
There are a few top-level classes exposed by the package: There are a few top-level classes exposed by the package:
- **Router**: Central event routing object. Routers facilitate route registration, - **Router**: Central event routing object. Routers facilitate route registration,
@ -17,3 +19,20 @@ There are a few top-level classes exposed by the package:
iNotify to dynamically respond to file events. iNotify to dynamically respond to file events.
- **Server**: Long-running process manager for listeners and optional live-reloading via - **Server**: Long-running process manager for listeners and optional live-reloading via
HTTP. Interfaces with listener `start()` and `shutdown()` for graceful interruption. HTTP. Interfaces with listener `start()` and `shutdown()` for graceful interruption.
# Install
```sh
pip install execlib
```
# Development
## Documentation
```sh
pip install execlib[docs]
```
## Testing
```sh
pip install execlib[tests]
```

BIN
docs/_static/execlib.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

View File

@ -860,14 +860,15 @@ class Router[E: Event]:
# manually track and cancel pending futures b/c `.shutdown(cancel_futures=True)` # manually track and cancel pending futures b/c `.shutdown(cancel_futures=True)`
# is misleading, and will cause an outer `as_completed` loop to hang # is misleading, and will cause an outer `as_completed` loop to hang
for future in tqdm( if self._active_futures:
list(self._active_futures), for future in tqdm(
desc=color_text( list(self._active_futures),
f'Cancelling {len(self._active_futures)} pending futures...', desc=color_text(
Fore.BLACK, Back.RED), f'Cancelling {len(self._active_futures)} pending futures...',
colour='red', Fore.BLACK, Back.RED),
): colour='red',
future.cancel() ):
future.cancel()
if self._thread_pool_2 is not None: if self._thread_pool_2 is not None:
# cancel pending futures (i.e., those not started) # cancel pending futures (i.e., those not started)

View File

@ -43,6 +43,7 @@ docs = [
"furo", "furo",
"myst-parser", "myst-parser",
] ]
jupyter = ["ipykernel"]
[project.urls] [project.urls]
Homepage = "https://doc.olog.io/execlib" Homepage = "https://doc.olog.io/execlib"