ignite-client 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a81b15f9a00bf89eb585f8065bd6e660ecb19e21e1b75a63b5e41df7302806dd
4
- data.tar.gz: 2894eb97340f58a8f8f40aa67a1aa3f7e3d6a2932b565339e551ec6b1b593204
3
+ metadata.gz: 277a2a525c7245552178a032720625ba7a63c14d240209602fcbfa8cab118d97
4
+ data.tar.gz: 648e9bdfa148eb1f5a45aa0f8b10a62a219c19933c6c03e0d22d84068856b25d
5
5
  SHA512:
6
- metadata.gz: 8813cce5db934323a6d32a922f85a2ab10b3acd0738d8b6899230ab261bedf2f95058bb6d40ae426581c75de635702a5bee42bef9ed7ac2ca54e7ab6c357f8f4
7
- data.tar.gz: 3f5798dace62b573e02b7c6b11859e1d607f4ae85a859b9bde29169b5e1b55f0d59000dad14940be4763636b3b721d53ae1e330353163cf099c968dd0e193596
6
+ metadata.gz: 3bbbb1683b3871db216a48c340f40daaaf48cd7e12373315efa08a88476e2221d64e13140a13dccaf4b915bd3038f55b5ed1e0123598d842e6b2cb84f9003857
7
+ data.tar.gz: dbd7de30343a7a771585af080f804c3f4f5f1c049504f3c174ace0fb39e725a2e14d95e3cb0a30359c3a1c13296ba07ca47323fa972bdd2246c6ee8410130728
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2 (2021-09-20)
2
+
3
+ - Added connect timeout
4
+
1
5
  ## 0.1.1 (2021-02-04)
2
6
 
3
7
  - Added support for array types
data/README.md CHANGED
@@ -95,6 +95,12 @@ Specify the host and port
95
95
  Ignite::Client.new(host: "localhost", port: 10800)
96
96
  ```
97
97
 
98
+ Specify the connect timeout [unreleased]
99
+
100
+ ```ruby
101
+ Ignite::Client.new(connect_timeout: 3)
102
+ ```
103
+
98
104
  ## Authentication
99
105
 
100
106
  For [authentication](https://ignite.apache.org/docs/latest/security/authentication), use:
data/lib/ignite/client.rb CHANGED
@@ -2,8 +2,12 @@ require "ignite"
2
2
 
3
3
  module Ignite
4
4
  class Client
5
- def initialize(host: "localhost", port: 10800, username: nil, password: nil, use_ssl: nil, ssl_params: {})
6
- @socket = TCPSocket.new(host, port)
5
+ def initialize(host: "localhost", port: 10800, username: nil, password: nil, use_ssl: nil, ssl_params: {}, connect_timeout: nil)
6
+ begin
7
+ @socket = Socket.tcp(host, port, connect_timeout: connect_timeout, resolv_timeout: connect_timeout)
8
+ rescue Errno::ETIMEDOUT
9
+ raise TimeoutError, "Connection timed out"
10
+ end
7
11
 
8
12
  use_ssl = use_ssl.nil? ? (username || password) : use_ssl
9
13
  if use_ssl
@@ -1,3 +1,3 @@
1
1
  module Ignite
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/lib/ignite.rb CHANGED
@@ -16,4 +16,5 @@ require "ignite/version"
16
16
  module Ignite
17
17
  class Error < StandardError; end
18
18
  class HandshakeError < Error; end
19
+ class TimeoutError < Error; end
19
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ignite-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-05 00:00:00.000000000 Z
11
+ date: 2021-09-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  requirements: []
50
- rubygems_version: 3.2.3
50
+ rubygems_version: 3.2.22
51
51
  signing_key:
52
52
  specification_version: 4
53
53
  summary: Ruby client for Apache Ignite