Skip to main content

Query extension for nameko.

Project description

Nameko extension for support of running queries.

Queries supports multiple replies for a single query sent and will be returned as a list.

Examples

from nameko_query.responder import query_responder

class BlockedListener(object):
    name = "service"
    routing_prefix = "service"

    @query_responder
    def method(self, parameters, message):
        return "hello world"
from nameko_query.request import ClusterQueryProxy

def query_request(service_name, method_name, parameters={}):
    with ClusterQueryProxy({"AMQP_URI": "amqp://guest:guest@localhost", timeout=0.05) as cluster_query:
        service = getattr(cluster_query, service_name)
        method = getattr(service, method_name)
        return method(parameters)

print query_request("service", "method", parameters)

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page