Server
The Server is used to build a RPC server which provides RPC Method to one or
more clients. A sample of a simple RPC server is shown here:
import callme
def add(a, b):
    return a + b
server = callme.Server(server_id='fooserver',
                       amqp_host='localhost')
server.register_function(add, 'add')
server.start()
- 
class callme.server.Server(server_id, amqp_host='localhost', amqp_user='guest', amqp_password='guest', amqp_vhost='/', amqp_port=5672, ssl=False, threaded=False, durable=False, auto_delete=True)
- This Server class is used to provide an RPC server. - 
| Parameters: | 
server_id – id of the serveramqp_host – the host of where the AMQP Broker is runningamqp_user – the username for the AMQP Brokeramqp_password – the password for the AMQP Brokeramqp_vhost – the virtual host of the AMQP Brokeramqp_port – the port of the AMQP Brokerssl – use SSL connection for the AMQP Brokerthreaded – use of multithreading, if set to true RPC call-execution
will processed parallel (one thread per call) which dramatically
improves performancedurable – make all exchanges and queues durableauto_delete – delete queues after all connections are closed | 
|---|
 
 - 
- 
is_running
- Return whether server is running. 
 - 
- 
register_function(func, name=None)
- Registers a function as rpc function so that is accessible from the
proxy. - 
| Parameters: | 
func – the function we want to provide as rpc methodname – the name with which the function is visible to the clients | 
|---|
 
 
 - 
- 
start()
- Start the server. 
 - 
- 
stop()
- Stop the server. 
 - 
- 
wait()
- Wait until server is started.