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.

Files for nameko-query, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size nameko_query-0.0.1-py2.py3-none-any.whl (6.4 kB) File type Wheel Python version any Upload date Hashes View
Filename, size nameko_query-0.0.2-py2.py3-none-any.whl (7.2 kB) File type Wheel Python version any Upload date Hashes View

Supported by

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