Class: Jp::AbstractClient
- Inherits:
-
Object
- Object
- Jp::AbstractClient
- Defined in:
- lib/rb/jp/client.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(queue, options = {}) ⇒ AbstractClient
constructor
A new instance of AbstractClient.
Constructor Details
#initialize(queue, options = {}) ⇒ AbstractClient
Returns a new instance of AbstractClient.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rb/jp/client.rb', line 5 def initialize queue, = {} [:host] ||= 'localhost' [:port] ||= 9090 [:poll_interval] ||= 1 @queue = queue @options = if [:client] @client = [:client] else socket = Thrift::Socket.new [:host], [:port] transport = Thrift::BufferedTransport.new socket protocol = Thrift::BinaryProtocol.new transport @client = JobPool::Client.new protocol transport.open end end |