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

JSON-RPC traversal #31

Open
tflorac opened this issue Apr 8, 2015 · 6 comments
Open

JSON-RPC traversal #31

tflorac opened this issue Apr 8, 2015 · 6 comments

Comments

@tflorac
Copy link

tflorac commented Apr 8, 2015

Hi,
I'm trying to use pyramid_rpc package.
How can I use it, so that I can call a "JSON-RPC" method on a given object (providing an interface) accessed through ZODB traversal?

Thanks, for any help,
Thierry

@mmerickel
Copy link
Member

JSON-RPC is a protocol over a particular endpoint. It does not mix well with url traversal. I don't have a good answer for you without more details, so I'll leave it at that.

@tflorac
Copy link
Author

tflorac commented Apr 11, 2015

Hi,
I was using JSON-RPC and sometimes XML-RPC before within Zope3 projects, where remote procedures were applied on a given "context" accessed through URL traversal.
So, as traversal is mentioned in your package documentation, I was wondering if the same scheme could be used with Pyramid RPC (which would probably require to NOT declare endpoints, as objects URLs can't be pre-defined...).

Regards,
Thierry

@mmerickel
Copy link
Member

Can you give me an example? You'd be POSTing a method call to an arbitrary URL?

Have you looked at @mcdonc's pyramid_xmlrpc package which allows xmlrpc on any traversal context?

@tflorac
Copy link
Author

tflorac commented May 20, 2015

Hi,

Le 2015-05-15 18:04, Michael Merickel a écrit :

Can you give me an example? You'd be POSTing a method call to an
arbitrary URL?

Yes, the goal is to be able to define RPC methods on given objects
classes, for whose instances can be stored anywhere into a ZODB.

Have you looked at @mcdonc [1]'s pyramid_xmlrpc package which allows
xmlrpc on any traversal context?

pyramid_xmlrpc seems to be a little outdated and unmaintained...
I don't remember if this was the only reason but I currently use
pyramid_rpc package which id an "official" Pyramid package which can be
used for XML-RPC as well as JSON-RPC.
This package also mentions that it allows traversal to any content, but
I can't figure out how it works... :-/

Regards,
Thierry

@mmerickel
Copy link
Member

Well "traversal to any context" isn't quite right, not sure where you're seeing that. You can specify a custom factory= and traverse= arg to each rpc endpoint, allowing you to do traversal after that endpoint is matched.

I think what you're asking for is interesting but I'm not sure how I'd support it right now. We would have to perform the json-rpc protocol detection on a global level instead of per-endpoint-url I think.

@mmerickel
Copy link
Member

@tflorac can you look at the pattern I'm proposing in #37?

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

2 participants