Class: Hoth::Transport::Workling

Inherits:
Base
  • Object
show all
Defined in:
lib/hoth/transport/workling.rb

Instance Attribute Summary

Attributes inherited from Base

#encoder

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Hoth::Transport::Base

Instance Method Details

#call_remote_with(*args) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/hoth/transport/workling.rb', line 12

def call_remote_with(*args)
  topic      = SimplePublisher::Topic.new(:name => "#{self.module.name.to_s.underscore}_subscribers__#{name.to_s.underscore}")
  connection = SimplePublisher::StarlingConnection.new(:host => endpoint.host, :port => endpoint.port)

  publisher = SimplePublisher::Publisher.new(:topic => topic, :connection => connection)
  publisher.publish(encoder.encode(args))
end