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

Do we need rpcExports? #10

Open
harendra-kumar opened this issue Jan 25, 2023 · 2 comments
Open

Do we need rpcExports? #10

harendra-kumar opened this issue Jan 25, 2023 · 2 comments

Comments

@harendra-kumar
Copy link
Member

We should be able to create an endpoint for any available function as long as the function arguments and the result are serializable.

@harendra-kumar
Copy link
Member Author

There are two places where we need an RPC wrapper of a function:

  1. In the main funciton of the rpc executable to expose an endpoint. We can always define a wrapper here inline without having to create a wrapper in the module where the function is defined.
  2. At the invocation site where we call an rpc function. We can create a wrapper here as well automatically. But if a function is being called at multiple sites we would like to avoid having to create the wrapper at all call sites, instead we create the wrapper in the module where the function is defined and export it for use everywhere.

@harendra-kumar
Copy link
Member Author

Now, instead of creating a record for all rpc symbols from a module, can we instead export them individually, something like this:

module A
    (
       funcX
     , RPC(funcX)
    )
where

where the macro RPC would just have an effect of adding a prefix or suffix to the name to create a unique wrapper name. Where we use the RPC wrapper of a function we can use that macro.

To define the wrapper in the module we would have:

$(mkRPCWrapper funcX)

@adithyaov adithyaov transferred this issue from another repository May 31, 2024
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

No branches or pull requests

1 participant