-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use birpc #28
Use birpc #28
Conversation
|
||
let rpcCallback: (data: any) => void | ||
const rpc = createBirpc<SharedWorkerFunctions, TestWorkerFunctions>( |
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.
is the idea meant to establish a bidirectional communication with the postgres docker container?
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.
not quite
AVA's architecture has one worker thread per test file (called a test worker) and one worker thread per "shared worker" (called... a shared worker)
previous to this PR, we implemented 2-way RPC calls between the test worker and shared workers ourselves, but using birpc really makes the intent and logic cleaner
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.
oh i see, this is to communicate with ava's worker thread
params: params as any, | ||
connection: connectionDetails, | ||
containerExec: async (command): Promise<ExecResult> => | ||
rpc.execCommandInContainer(command), |
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.
you weren't kidding this is definitely way simpler
Took me a while but this looks like a solid update! |
# [7.2.0](v7.1.0...v7.2.0) (2024-04-05) ### Features * Merge pull request [#28](#28) from seamapi/feat-use-birpc ([ffcbb79](ffcbb79))
Greatly simplifies code and paves the way for us to grab a new database instance within
beforeTemplateIsBaked()
in application code.