Class: TxCatcher::Catcher

Inherits:
Object
  • Object
show all
Defined in:
lib/txcatcher/catcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, socket: "ipc:///tmp/") ⇒ Catcher

Returns a new instance of Catcher.



7
8
9
10
11
12
13
14
15
# File 'lib/txcatcher/catcher.rb', line 7

def initialize(name:, socket: "ipc:///tmp/")
 @queue = {}
 @sockets  = {}

  {'rawtx' => "#{socket}#{name}.rawtx", 'hashblock' => "#{socket}#{name}.hashblock"}.each do |channel, address|
    LOGGER.report "Start listening on #{name} #{channel}... (#{address})"
    listen_to_zeromq_message(channel: channel, address: address)
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/txcatcher/catcher.rb', line 5

def name
  @name
end

#socketsObject

Returns the value of attribute sockets.



5
6
7
# File 'lib/txcatcher/catcher.rb', line 5

def sockets
  @sockets
end