otstatus 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/otstatus.rb +8 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3372fd858d8fed587c986227cb1e530a0a2a456d
4
- data.tar.gz: dc722af8b79ffe69c2d0967e4df204fc05334ca4
3
+ metadata.gz: a9f31d3c7b6e16c2f433696d113ca5828c9dcafd
4
+ data.tar.gz: d89967af4ac327002ae74d44b3e5da54e6d465a5
5
5
  SHA512:
6
- metadata.gz: 7f49b93f29d113980e0f59e8df5d3e52cb3f0a8206bf09ab3b4ffc75407f921ac9967f2f1c7fedad2eb91ab29f8798ed77364c5fb219d3316dccfda559137ca4
7
- data.tar.gz: 30943fbd2480e83b7fb94d2a75911604ab46191561b623ec51f32883abb955c758acf38b3a21e58718c772dab27dde568c05edddd037039f15f7a0a298c1ed12
6
+ metadata.gz: 98a67064776b004bb1e27ee26578606a63d086841f5c7c01d4c35ad4d26b56ca5b9aaa126c47702ac39a0c67d4548875dadd5c5243f3a1550bed2d3b4d9ed2c7
7
+ data.tar.gz: 82a7f100f37b4360dba681d5c37e5b95039e2ba258318d42649e5b22edc1d806a5f9a38a82b50813fb70eb08afca6999ec2fedc021103e8b36dbb2327cb9252e
@@ -3,18 +3,20 @@ require 'eventmachine'
3
3
  require 'nori'
4
4
 
5
5
  module OtStatus
6
- VERSION = '0.2.1'
6
+ VERSION = '0.2.3'
7
7
 
8
8
  class Query
9
9
  attr_accessor :response
10
10
 
11
- def initialize
11
+ def initialize connect_timeout=5, inactivity_timeout=10
12
12
  @response = nil
13
+ @connect_timeout = connect_timeout
14
+ @inactivity_timeout = inactivity_timeout
13
15
  end
14
16
 
15
17
  def run hostname, port
16
18
  EventMachine.run {
17
- EventMachine::connect hostname, port, Connection, self
19
+ EventMachine::connect hostname, port, Connection, self, @connect_timeout, @inactivity_timeout
18
20
  }
19
21
 
20
22
  parse @response
@@ -31,8 +33,10 @@ module OtStatus
31
33
 
32
34
  attr_reader :query
33
35
 
34
- def initialize query
36
+ def initialize query, connect_timeout, inactivity_timeout
35
37
  @query = query
38
+ self.pending_connect_timeout = connect_timeout
39
+ self.comm_inactivity_timeout = inactivity_timeout
36
40
  end
37
41
 
38
42
  def post_init
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: otstatus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Thelander