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.


from nameko_query.responder import query_responder

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

    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.

Built Distributions

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

Uploaded any

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

Uploaded any

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page