Proxy
The Proxy manages the client part of the RPC system:
Usage example:
import callme
proxy = callme.Proxy(amqp_host='localhost')
print(proxy.use_server('fooserver').add(1, 1))
- 
class callme.proxy.Proxy(server_id, amqp_host='localhost', amqp_user='guest', amqp_password='guest', amqp_vhost='/', amqp_port=5672, ssl=False, timeout=60, durable=False, auto_delete=True)
- This Proxy class is used to handle the communication with the rpc
server. - 
| Parameters: | 
server_id – default id of the Server (can be declared later
see use_server())amqp_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 Brokertimeout – default timeout for calls in secondsdurable – make all exchanges and queues durableauto_delete – delete server queues after all connections are closed
not applicable for client queues | 
|---|
 
 - 
- 
use_server(server_id=None, timeout=None)
- Use the specified server and set an optional timeout for the method
call. - Typical use: - 
- >> my_proxy.use_server(‘fooserver’).a_remote_func() 
 - 
| Parameters: | 
server_id – the server id where the call will be madetimeout – set or overrides the call timeout in seconds | 
|---|
 | Return type: | return self to cascade further calls | 
|---|