-
Notifications
You must be signed in to change notification settings - Fork 7
feat: Add rpc-methods package
#474
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
Conversation
|
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
041f8bc to
5fe6aef
Compare
- Add rpc-methods package for internal RPC calls - Consolidate PromiseCallbacks type into utils package
b231d66 to
505aed9
Compare
| { | ||
| files: ['**/test/**/*', '**/*.test.ts', '**/*.test.tsx'], | ||
| rules: { | ||
| '@typescript-eslint/explicit-function-return-type': 'off', | ||
| }, | ||
| }, |
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.
Incidental change: This is a common pattern in our tests that is completely fine.
sirtimid
left a comment
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.
Great! 🤩
…#481) Progresses: #369 Continues the work of #369 by replacing the "vat worker" command / reply types with the pattern introduced in #474. This primarily affects the extension, since only its `VatWorkerManager` (so renamed from `VatWorkerService`) logically crosses process boundaries. Its Node.js counterpart is just a class that lives next to the kernel, and is only affected by some renamed types.
…#487) Closes: #369 Replaces all kernel and vat "message" types with the new `RpcClient` / `RpcService` pattern. For related work and the justification for this, see: - #369 - #474 - #481 Note that, in the course of implementing this refactor, it was discovered that we are never returning _any_ responses to syscalls originating from vat supervisors. This PR maintains a provisional solution using the new pattern, and #488 tracks the work to actually fix this.
Progresses: #369
Introduces a new package,
@ocap/rpc-methods, whose primary affordances are two:RpcClientandRpcService. These classes are intended to represent the call-er and call-ee ends of an RPC relationship. In brief, you:RpcClient.call()RpcService.execute()These two classes consume "method" and "handler" specifications. The idea is that you specify your methods individually, gather these specifications together into a "specification" or "handler" record, and then let the rest of your RPC types follow from there.
Our first target for this pattern is the "kernel control methods", where we are able to replace the
MessageResolverandCommandRegistryabstractions, as well as the hated request / response structs. Seepackages/extension/src/kernel-integration/handlersfor where most of this action occurred. Although this PR consists of equal amounts of additions and deletions, you'll note the kernel control method implementation in the extension is significantly simplified (+700 / -1300).The application's behavior should be virtually unaffected by this change. Following this PR, we will target other RPC channels in order to get rid of their request / response structs as well.