class RBKubeMQ::Client

Attributes

host[R]
port[R]
tls[R]
uri[R]
ws[R]

Public Class Methods

new(host:, port: "9090", tls: false) click to toggle source
# File lib/client.rb, line 5
def initialize(host:, port: "9090", tls: false)
  @host = host
  @port = port
  is_class?(tls, [FalseClass, TrueClass], "tls")
  @tls  = tls
  @uri = "http"
  @uri += "s" if @tls
  @uri += "://#{host}:#{port}"
  @ws = "ws"
  @ws += "s" if @tls
  @ws += "://#{host}:#{port}"
end

Public Instance Methods

sender(*args) click to toggle source
# File lib/client.rb, line 20
def sender(*args)
  args[0] ||= {}
  args[0][:client] = self if args[0].is_a?(Hash)
  RBKubeMQ::Sender.new(*args)
end
streamer(*args) click to toggle source
# File lib/client.rb, line 26
def streamer(*args)
  args[0] ||= {}
  args[0][:client] = self if args[0].is_a?(Hash)
  RBKubeMQ::Streamer.new(*args)
end
subscriber(*args) click to toggle source
# File lib/client.rb, line 32
def subscriber(*args)
  args[0] ||= {}
  args[0][:client] = self if args[0].is_a?(Hash)
  RBKubeMQ::Subscriber.new(*args)
end