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

Support positional argument in wrapped handlers #59

Merged
merged 4 commits into from
Oct 24, 2021

Conversation

creachadair
Copy link
Owner

Add a new top-level function handler.Positional. Like Check, it accepts a function to be wrapped as a jrpc2.Handler. Unlike Check, this function allows positional arguments, which it implements by constructing a wrapper that takes a synthetic struct type as its argument, and redirects the fields of the struct to the positional arguments of the original function when the wrapper is called.

Add a new top-level function handler.Positional. Like Check, it accepts a
function to be wrapped as a jrpc2.Handler. Unlike Check, this function allows
positional arguments, which it implements by constructing a wrapper that takes
a synthetic struct type as its argument, and redirects the fields of the struct
to the positional arguments of the original function when the wrapper is called.
@creachadair creachadair added the enhancement New feature or request label Oct 24, 2021
@creachadair creachadair self-assigned this Oct 24, 2021
@creachadair creachadair merged commit 98d5ca4 into default Oct 24, 2021
@creachadair creachadair deleted the positional-handlers branch October 24, 2021 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant