Emplocity / nameko-prometheus

Prometheus metrics collector and exporter for nameko microservice framework
https://pypi.org/project/nameko-prometheus/
Other
19 stars 5 forks source link

Consider singledispatch instead of isinstance checks #8

Closed zsiciarz closed 3 years ago

zsiciarz commented 4 years ago

As of now we explicitly check entrypoint types in worker_result(). We could dispatch on the entrypoint type instead.

Note: singledispatchmethod was added in Python 3.8. If we want to dispatch to PrometheusMetrics methods, we need to provide backport for 3.6-3.7.

zsiciarz commented 4 years ago

There's a backport on PyPI: https://pypi.org/project/singledispatchmethod/

zsiciarz commented 3 years ago

Released in 1.1.0.