class Nsq::Discovery

Included Modules

Defined in:

nsq/discovery.cr

Constructors

Instance Method Summary

Instance methods inherited from module Nsq::AttributeLogger

debug(msg) debug, error(msg) error, fatal(msg) fatal, info(msg) info, warn(msg) warn

Class methods inherited from module Nsq::AttributeLogger

included(klass) included

Constructor Detail

def self.new(lookupds : Array(String) = Array(String)) #

lookupd addresses must be formatted like so: ':'


[View source]

Instance Method Detail

def nsqds #

Returns an array of nsqds instances

nsqd instances returned are strings in this format: ':'

discovery.nsqds
#=> ['127.0.0.1:4150', '127.0.0.1:4152']

If all nsqlookupd's are unreachable, raises Nsq::DiscoveryException


[View source]
def nsqds_for_topic(topic : String) #

Returns an array of nsqds instances that have messages for that topic.

nsqd instances returned are strings in this format: ':'

discovery.nsqds_for_topic('a-topic')
#=> ['127.0.0.1:4150', '127.0.0.1:4152']

If all nsqlookupd's are unreachable, raises Nsq::DiscoveryException


[View source]