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

Features for reverse calls, notifs, custom-params #88

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Jan 9, 2023

  • Support making calls from server side
  • Support handling server calls on the client side
  • Support renaming client calls
  • Support sending notifications
  • Support sending/receiving params with non-array serialization

All of the above is needed to make it possible to implement / consume eth_subscribe correctly with this library.

See rpc_test.go for usage examples.

@magik6k magik6k force-pushed the feat/reverese-calling branch 4 times, most recently from 53e73de to 5abb7ba Compare January 9, 2023 17:33
@magik6k magik6k marked this pull request as ready for review January 9, 2023 18:07
@magik6k magik6k force-pushed the feat/reverese-calling branch from 5abb7ba to 72c92bf Compare January 9, 2023 18:07
@magik6k
Copy link
Contributor Author

magik6k commented Jan 10, 2023

This is related to filecoin-project/lotus#9863 (comment)

@raulk raulk self-requested a review January 10, 2023 15:22
@magik6k
Copy link
Contributor Author

magik6k commented Jan 10, 2023

Reviewer note - reviewing commit-by-commit may be easiest, I tried to put each feature into it's own commit.

@magik6k magik6k force-pushed the feat/reverese-calling branch from da92324 to 81b43de Compare January 23, 2023 23:14
@magik6k magik6k force-pushed the feat/reverese-calling branch from 81b43de to 36330f4 Compare January 25, 2023 17:58
Comment on lines +460 to +462
// hasCtx is 1 if the function has a context.Context as its first argument.
// Used as the number of the first non-context argument.
hasCtx int

Choose a reason for hiding this comment

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

Thanks for commenting this. Very confusing.

Copy link

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

Approved with one question

var t T
err := json.Unmarshal(p, &t)

// todo also handle list-encoding automagically (json.Unmarshal doesn't do that, does it?)

Choose a reason for hiding this comment

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

Do we need this now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it's a nice to have, but not needed afaict. The spec doesn't say that endpoints need to support both, so it's up to the endpoint really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants