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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

nameko_query-0.0.2-py2.py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 2 Python 3

nameko_query-0.0.1-py2.py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page