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

Add initial transactor rpc #7490

Open
wants to merge 4 commits into
base: UBERF-7922p3
Choose a base branch
from
Open

Add initial transactor rpc #7490

wants to merge 4 commits into from

Conversation

Chunosov
Copy link
Contributor

@Chunosov Chunosov commented Dec 17, 2024

@Chunosov Chunosov requested a review from aonnikov December 17, 2024 08:55

export class TransactorRPC extends WorkerEntrypoint<Env> {
async rpcFindAll (
token: string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add workspaceId here, so could think about security at next step

Copy link
Member

@aonnikov aonnikov Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that we have to pass token and workspaceId fro every request. I propose to use stubs to hide this.
In the transactor there will be only one method, named connect (or any other name) that will return stub with two methods: find and tx.

https://developers.cloudflare.com/workers/runtime-apis/rpc/

using client = env.TRANSACTOR.connect(token, workspaceId)
await client.tx(...)

haiodo and others added 3 commits December 18, 2024 14:49
Signed-off-by: Andrey Sobolev <[email protected]>
Signed-off-by: Nikolay Chunosov <[email protected]>
Signed-off-by: Nikolay Chunosov <[email protected]>
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.

3 participants