-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more hooks to support structlog contextvars #36
Conversation
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
Codecov Report
@@ Coverage Diff @@
## main #36 +/- ##
==========================================
- Coverage 95.71% 94.89% -0.82%
==========================================
Files 8 8
Lines 467 490 +23
==========================================
+ Hits 447 465 +18
- Misses 20 25 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. I wonder if a future refactor could use something like event emitter pattern rather than defining hook functions (https://pypi.org/project/PyEventEmitter/)
450e966
to
0fa318b
Compare
context_hook
that's called by inbound worker, outbound worker, and poll worker during their respectivewhile True
loops. Intended to be used to setstructlog.contextvars.bind_contextvars
in application code. Can be defined as class methods or attached to an instance.Related PA issue https://github.com/noteable-io/planar-ally/pull/243