Nsqlookupd client

class gnsq.LookupdClient(host='localhost', port=4161, **kwargs)[source]

Low level http client for nsqlookupd.

Parameters:
  • host – nsqlookupd host address (default: localhost)
  • port – nsqlookupd http port (default: 4161)
  • useragent – useragent sent to nsqlookupd (default: <client_library_name>/<version>)
  • connection_class – override the http connection class
channels(topic)[source]

Returns all known channels of a topic.

create_channel(topic, channel)[source]

Add a channel to nsqlookupd’s registry.

create_topic(topic)[source]

Add a topic to nsqlookupd’s registry.

delete_channel(topic, channel)[source]

Deletes an existing channel of an existing topic.

delete_topic(topic)[source]

Deletes an existing topic.

classmethod from_url(url, **kwargs)

Create a client from a url.

info()[source]

Returns version information.

lookup(topic)[source]

Returns producers for a topic.

nodes()[source]

Returns all known nsqd.

ping()[source]

Monitoring endpoint.

Returns:should return “OK”, otherwise raises an exception.
tombstone_topic(topic, node)[source]

Tombstones a specific producer of an existing topic.

topics()[source]

Returns all known topics.

class gnsq.Lookupd(address='http://localhost:4161/', **kwargs)[source]

Use LookupdClient instead.

Deprecated since version 1.0.0.

base_url

Use LookupdClient.address instead.

Deprecated since version 1.0.0.

tombstone_topic_producer(topic, node)[source]

Use LookupdClient.tombstone_topic() instead.

Deprecated since version 1.0.0.