celalertug / amqp-py-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

usage

simple rpc amqp python library on pike

consumer

s = ServiceCreator('amqps://user:password@host.cloudamqp.com/vhost',
                   "exchangepypy")


def cb(msg):
    print(msg)
    return msg


s.consume("py.test", "", cb)

rpc request

s = ServiceCreator('amqps://user:password@host.cloudamqp.com/vhost',
                   "exchangepypy")


res,err = s.rpc_request("py.test", "sdsdsdsd", 0)
print(res,err)

fire and forget

s = ServiceCreator('amqps://user:password@host.cloudamqp.com/vhost',
                   "exchangepypy")

s.fire_and_forget("py.test", "cvvccvvcv")

About


Languages

Language:Python 100.0%