Skip to content
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

refactor(query): middleware naming and supervisor work #25

Merged
merged 10 commits into from
Nov 22, 2023

Conversation

neurosnap
Copy link
Owner

@neurosnap neurosnap commented Nov 21, 2023

This PR cleans up some of the middleware naming and wrapping them all inside a named export mdw. This should make the officially supported middleware a little more discoverable while also simplifying the naming conventions for them.

None of the previous names have been removed, merely deprecated, with plans to remove entirely in a later version.

Similarly, we have refactored the ctx.json Result type to better match effection's Result type. Instead of ctx.json.data we have ctx.json.value and ctx.json.error respectively. ctx.json.data has not been removed, but has been marked as deprecated.

Hopefully this transition for users is smooth.

Further, I spent some time improving our generic supervise() function which will try to always keep an Operation alive. This is in an effort to create fault tolerant structured concurrency.

I also implemented LogContext which is a channel for us to send log events to in the case where it is impossible to return a Result -- like with supervisors. This allows end-users to not only send events through the logger, but also to listen to those events and do something with them (like send to log drains).

@neurosnap neurosnap marked this pull request as ready for review November 21, 2023 16:58
@neurosnap neurosnap merged commit 2e93eae into main Nov 22, 2023
@neurosnap neurosnap deleted the refactor-query-mdw branch November 22, 2023 17:09
@neurosnap neurosnap changed the title refactor(query): middleware naming refactor(query): middleware naming and supervisor work Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant