[email protected]
[Top] [All Lists]

[Medusa-dev] async question

Subject: [Medusa-dev] async question
From: lluis gomez i bigorda
Date: Fri, 08 May 2009 01:27:02 +0200
hello all,

i'm justr trying to setup a simple server using medusa but I think I'm doing something wrong cause it's not async at all ::
my script is something like this ::

from socket import gethostname
from medusa.xmlrpc_handler import xmlrpc_handler
from medusa.http_server import http_server
import asyncore

class xmlrpc_server(xmlrpc_handler):
    # initialize and run the server
    def __init__(self, host=None, port=8182):
        if host is None:
            host = gethostname( )
        hs = http_server(host, port)
        asyncore.loop( )
    # an example of a method to be exposed via the XML-RPC protocol
    def add(self, op1, op2):
        return op1 + op2
    # an infinite loop
    def  (self, op1, op2):
        while (op1>2):
                op1 = op2
        return False

    # the infrastructure ("plumbing") to expose methods
    def call(self, method, params):
        print "calling method: %s, params: %s" % (method, params)
        if method == 'add':
            return self.add(*params)
        if method == ' ':
            return self. (*params)
        return "method not found: %s" % method
if __name__ == '__main__':
    server = xmlrpc_server( )

ok ... the server works but if one client call the procedure " " the server will not attend any other petiotions ...
can anybody explain what i'm missing please?

thank you very much in advance,

Medusa-dev mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>