Sha256: 26960f389673932be8dd275e7c6f1444e5ecc1ea0eb7283be17545f15e70fd81

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

begin
  require 'simple_publisher'
rescue LoadError
  STDERR.puts "You need the simple_publisher gem if you want to use Workling/Starling transport."
end

module Hoth
  module Transport
    
    class WorklingTransport < HothTransport
      
      def call_remote_with(*args)
        topic      = SimplePublisher::Topic.new(:name => "#{endpoint.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(args)
      end
      
      def decode_params(*params)
        params
      end
      
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hoth-0.1.2 lib/hoth/transport/workling_transport.rb
hoth-0.1.1 lib/hoth/transport/workling_transport.rb