Skip to content

desertthunder/async-python-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Python

This is a short command line application built with click to demonstrate the concepts of asynchronous programming in Python. The application includes two subcommands, http and queue, which demonstrate the use of asynchronous HTTP requests and simple distributed task queues, respectively.

Setup

Python versions are managed with asdf and Poetry is for dependency management. A requirements.txt is included if you prefer to use pip.

pip Setup

pip install -r requirements.txt

poetry Setup

asdf install python 3.12.3
pip install poetry
asdf reshim
poetry env use python3.12
source .venv/bin/activate
poetry install

Usage

$ python -m cli --help
Usage: python -m cli [OPTIONS] COMMAND [ARGS]...

  Demo Command line for asynchronous programming post.

Options:
  --help  Show this message and exit.

Commands:
  http   Requests & HTTPx demo.
  queue  Basic task queue demo.
$ python -m cli http --help
Usage: python -m cli http [OPTIONS] COMMAND [ARGS]...

  Requests & HTTPx demo.

Options:
  --help  Show this message and exit.

Commands:
  async     Run asynchronous HTTP requests using HTTPx.
  requests  Run HTTP requests using the requests library.
  sync      Run synchronous HTTP requests using HTTPx.
$ python -m cli queue --help
Usage: python -m cli queue [OPTIONS] COMMAND [ARGS]...

  Basic task queue demo.

Options:
  --help  Show this message and exit.

Commands:
  async  Run asynchronous non-blocking tasks.
  sync   Run synchronous blocking tasks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages