#5437 closed task (fixed)
AMF support
Reported by: | Thijs Triemstra | Owned by: | Olemis Lang |
---|---|---|---|
Priority: | high | Component: | TracRpcProtocolsPlugin |
Severity: | normal | Keywords: | rpc |
Cc: | Thijs Triemstra, Olemis Lang, osimons | Trac Release: | 0.11 |
Description
PyAMF provides Action Message Format (AMF) support for Python that is compatible with the Adobe Flash Player. It includes integration with Python web frameworks like Django, Pylons, Twisted and SQLAlchemy.
The Adobe Integrated Runtime and Adobe Flash Player use AMF to communicate between an application and a remote server. AMF encodes remote procedure calls (RPC) into a compact binary representation that can be transferred over HTTP/HTTPS or the RTMP/RTMPS protocol. Objects and data values are serialized into this binary format, which increases performance, allowing applications to load data up to 10 times faster than with text-based formats such as XML or SOAP.
It would be great to add AMF support to the XmlRpcPlugin (or TracRpc plugin), similar to the new JSON support, allowing you to query from the Flash Player without requiring any additional Actionscript libraries.
Attachments (2)
Change History (21)
comment:1 Changed 16 years ago by
Owner: | changed from osimons to Thijs Triemstra |
---|---|
Status: | new → assigned |
Type: | defect → enhancement |
comment:2 Changed 16 years ago by
Adding JSON-RPC was a proof-of-concept for what was needed to provide the support for more protocols to the plugin, and also a test-bed for making all methods protocol agnosting by just working with regular Python types (except xmlrpclib.Binary
for the time being). And, it was done in a least-effort/least-obtrusive manner to avoid breaking (or even touching) the XML-RPC code as it was stabilizing from the many recent fixes and improvements.
Next step would be to refactor the core handling of call/input/output/error handling + docs, so that it gets abstracted into protocol-providers using an extension point. That way it becomes simple to add further protocols either to the plugin itself, or as separate plugins.
And yes, renaming the plugin (#5436) would make sense then. As would removing the various /xmlrpc
and /jsonrpc
urls, and just provide /rpc
and /login/rpc
that uses content-type or other request information to find the correct provider. That is roughly the essence for my version 1.1.0 plans.
Help welcome :-)
comment:3 Changed 16 years ago by
Should also mention that #5382 was part of the plan - I don't want to do a full rework of the plugin before there is decent coverage in the functional tests that now come with the plugin. Its now quite decent for core functionality, allthough a lot of 'plain' method tests are still missing.
Changed 15 years ago by
Changed 15 years ago by
Attachment: | amf-client.py added |
---|
comment:4 Changed 15 years ago by
Owner: | changed from Thijs Triemstra to osimons |
---|---|
Status: | assigned → new |
I added a patch for AMF support using PyAMF (easy_install pyamf
) against version 1.0.6 of the plugin. I also included an AMF client for Python.
Some things I need to do are proper error raising and looking into Binary to ByteArray conversion. I hope this patch gives a better impression of the future direction the JSON/AMF/etc support should/could go.
comment:5 Changed 15 years ago by
I've have a working implementation of an IRPCProtocolProvider
interface, to completely abstract all communication and content normalization into own modules - and thereby also making it easily pluggable. It has been somewhat slower to finish as I've been busy with other things + middle of summer holiday. I want to review it a bit more + improve docs and make that pluggable too - and get tests for everything running ok.
Thanks for the AMF patch - helpful to correlate the needs of the interface. I'll be back soon-ish with a new infrastructure to allow you to redo it in a cleaner fashion... Stay tuned :-)
comment:6 follow-up: 7 Changed 15 years ago by
Cc: | Olemis Lang added |
---|
comment:7 follow-up: 9 Changed 15 years ago by
Owner: | changed from osimons to Olemis Lang |
---|---|
Status: | new → assigned |
Replying to anonymous:
I've have a working implementation of an IRPCProtocolProvider interface, to completely abstract all communication and content normalization into own modules - and thereby also making it easily pluggable.
A patch for the protocol API is available. It works with r7194 and is work in progress.
Thanks for the AMF patch - helpful to correlate the needs of the interface. I'll be back soon-ish with a new infrastructure to allow you to redo it in a cleaner fashion... Stay tuned :-)
You can clone the patches repository or suscribe to the repository feed in order to get the latest version of the patch.
Feedback is welcome !
:o)
comment:8 Changed 15 years ago by
Owner: | changed from Olemis Lang to osimons |
---|---|
Status: | assigned → new |
osimons is still in charge ;o)
comment:9 follow-up: 12 Changed 15 years ago by
Cc: | osimons added |
---|---|
Component: | XmlRpcPlugin → TracRpcProtocolsPlugin |
Keywords: | rpc added |
Owner: | changed from osimons to Olemis Lang |
Priority: | normal → high |
Type: | enhancement → task |
Replying to olemis:
Replying to anonymous:
I've have a working implementation of an IRPCProtocolProvider interface, to completely abstract all communication and content normalization into own modules - and thereby also making it easily pluggable.
A patch for the protocol API is available. It works with r7194 and is work in progress.
Thanks for the AMF patch - helpful to correlate the needs of the interface. I'll be back soon-ish with a new infrastructure to allow you to redo it in a cleaner fashion... Stay tuned :-)
You can clone the patches repository or suscribe to the repository feed in order to get the latest version of the patch.
I started a reference implementation based on your previous patch. It will be incorporated in the first release of TracRpcProtocolsPlugin after publishing the new API. With time it might be distributed in official XmlRpcPlugin . If you want to try what's been done or join the development then please reply and I will let you know. For the moment please read this article for further information. It's written in Spanish so, if you prefer, wait until I can either translate it or publish the source code. You could also use Google Translate gadget found in that page.
Your enhancement proposal was very useful.
Thanks !
Feedback is welcome !
Once I publish the source code, I will let you know.
:o)
PS: osimons , feel free to bring it back if you prefer this issue tracked by XmlRpcPlugin ;o)
comment:10 Changed 15 years ago by
Status: | new → assigned |
---|
comment:12 Changed 15 years ago by
Replying to olemis:
For the moment please read this article for further information. It's written in Spanish so, if you prefer, wait until I can either translate it or publish the source code. You could also use Google Translate gadget found in that page.
JFTR english version of the article is available. I'll let you know about the details to try it out ASAIC.
comment:13 follow-up: 18 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've published the mercurial repository .
In order to try it out it's necessary to qclone XmlRpcPlugin patch queue repository (MQ extension MUST be enabled ;o) and apply the most recent patch(es) i.e.
$ hg qclone http://bitbucket.org/osimons/trac-rpc-mq /path/to/rpc/repos
$ cd /path/to/local/repos
$ hg qpush -a
build from sources and install the plugin (many options BTW). Alternately it's also possible to download latest unstable sdist available at http://bitbucket.org/osimons/trac-rpc-mq/downloads
Then clone the repository
$ hg clone ssh://simelo.hg.sourceforge.net/hgroot/simelo/trac-rpcext /path/to/rpcext/repos
build from sources, enable plugins , ... and follow the instructions found in RPC docs page. That's it !
Feedback is welcome. Enjoy !
comment:14 follow-up: 15 Changed 15 years ago by
So can #5436 be closed now since that became the TracRpcProtocolsPlugin?
comment:15 Changed 15 years ago by
Replying to thijs:
So can #5436 be closed now
Should remain open . We tried to include that in this patch but it's a non-trivial task. osimons should make a decision.
since that became the TracRpcProtocolsPlugin?
Not exactly . XmlRpcPlugin is not gonna die. TracRpcProtocolsPlugin will be something like a sandbox where other protocols will be implemented. They will remain there 'cause they are experimental, or due to conflicting dependencies, or ... The idea is to transition those components towards XmlRpcPlugin if it's better and appropriate to do so.
comment:16 Changed 15 years ago by
(In [7916]) XmlRpcPlugin: Pluggable protocols through new API + rework of most request-handling internals. Bump version to 1.1.0.
Closes #5437. Big thanks to Olemis Lang for getting this completed.
comment:17 Changed 15 years ago by
A somewhat premature close on this ticket, but at least now the pluggable-protocols code is in the repository and available for general use and extension. Thanks!
comment:18 follow-up: 19 Changed 15 years ago by
Replying to olemis:
Then clone the repository
$ hg clone ssh://simelo.hg.sourceforge.net/hgroot/simelo/trac-rpcext /path/to/rpcext/repos
unfortunately this isn't working, I get a login prompt for permissions i don't have afaik. I opened #7097 for that issue. I've also opened a ticket for PyAMF to add some documentation on how to use this plugin. Thanks!
comment:19 Changed 15 years ago by
Replying to thijs:
Replying to olemis:
Then clone the repository
$ hg clone ssh://simelo.hg.sourceforge.net/hgroot/simelo/trac-rpcext /path/to/rpcext/repos
unfortunately this isn't working, I get a login prompt for permissions i don't have afaik. I opened #7097 for that issue.
You're right, sorry, I specified the address of read/write repository. Try this (worked for me few minutes ago ;o)
$ hg clone http://simelo.hg.sourceforge.net:8000/hgroot/simelo/trac-rpcext /path/to/rpcext/repos
I've also opened a ticket for PyAMF to add some documentation on how to use this plugin. Thanks!
Cool ! Could you please add my email (olemis+trac at gmail.com) to the CC list (can't do that myself :( ) ?
Thnx !