Skip to content

safehammad/mustaine

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
This branch is 12 commits ahead, 1 commit behind bgilmore:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

About

Mustaine is a Python implemention of the Hessian 1.0.2 specification, a binary web services protocol. The library currently provides a standard HTTP-based client as well as a general-purpose serialization library. Server support is planned.

Usage

Using mustaine.client

Testing against Caucho's reference service:

from mustaine.client import HessianProxy
service = HessianProxy("http://hessian.caucho.com/test/test")
print service.replyDate_1()

Using mustaine.server

An object can be served via WSGI by wrapping it with the provided mustaine.server.WsgiApp. An object's methods are only exposed if decorated with mustaine.server.exposed decorator. For example:

from mustaine.server import exposed

class Calculator(object):
    @exposed
    def add(self, a, b):
        return a + b

    @exposed
    def subtract(self, a, b):
        return a - b

The following code will serve a Calculator object on port 8080 using the Python reference WSGI server:

from wsgiref import simple_server
from mustaine.server import WsgiApp
s = simple_server.make_server('', 8080, WsgiApp(Calculator()))
s.serve_forever()

This object can now be accessed over the network as already described:

>>> from mustaine.client import HessianProxy
>>> h = HessianProxy('http://localhost:8080/')
>>> h.add(2, 3)
5

Source

Up-to-date sources and documentation can always be found at the mustaine GitHub site.

About

Hessian RPC library for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%