Skip to content

Commit

Permalink
broker: tie in with amqp backend
Browse files Browse the repository at this point in the history
Creates the WorkerRegistry object to
- track alive workers and their metrics
- submit client requests to workers

Creates the Worker object to
- hold a workers metric
- wrap queue interaction for the worker

Creates the Broker object to
- connect the HTTP API call to WorkerRegistry functions

Library wise these changes are included:
- Adds pika as the amqp connection library and bottle to replace the
  comparatively heavy flask and Werkzeug libraries.
  Bottle can be used with less global state and inside a class, which
  allows to track state within class members.

- Introduces structlog, for log messages that can also expose key/value
  pairs for structered logging.
  • Loading branch information
mweinelt committed Nov 16, 2020
1 parent e3537f3 commit 09cee4e
Show file tree
Hide file tree
Showing 3 changed files with 241 additions and 143 deletions.
167 changes: 52 additions & 115 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ license = "GPL-2.0-only"
authors = []

[tool.poetry.scripts]
wgkex-broker = "wgkex.broker.app:app"
wgkex-broker = "wgkex.broker.app:main"

[tool.poetry.dependencies]
python = "^3.6"
PyYAML = "^5.3.1"
Flask = "^1.1.2"
voluptuous = "^0.12.0"
pika = "^1.1.0"
structlog = "^20.1.0"
bottle = "^0.12.19"

[tool.poetry.dev-dependencies]
black = "^20.8b1"
Expand Down
Loading

0 comments on commit 09cee4e

Please sign in to comment.