Skip to content

Nice and Easy Server Calls (or How to keep your hair when developing rAA plugins)

Previous to last weekend, the process for setting up a rAA plugin to talk to the backend looked like the following:
  1. Set up a schedule object (one time or immediate based on whether you want to block or not).
  2. Set up a table to hold whatever data you need when doing the operation, or more recently use plugin properties.
  3. Link the schedule Id from the schedule object in 1 with the data in 2. For immediate tasks, you needed to do this through a callback.
  4. Implement XMLRPC interfaces on the webside to retrieve the data in 2, and to save the results.
  5. Add a logical branch in your backend doTask method to do the new functionality, making xmlrpc calls as appropriate to retrieve the data for processing, and store the result.
  6. Write a callback method to retrieve the result saved above.


Basically that sucked. Now, the process is as follows.
  1. On the web side, make a call to self.callBackend passing in the method name on the backend to call as well as any arguments to pass.
  2. On the server side, implement that function and return a result.

Notice that no XMLRPC interfaces need designing, no additional tables need creating, and no callbacks are needed to retrieve the data.

This currently only works for synchronous tasks where the page request will block until the results are available, but in the future, there will be another method (called callBackendAsync) that will make longer running tasks easy (in conjunction with the CallbackStatusWidget). I hope that I can get to that soon.