ione 1.1.3 → 1.1.4

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
  SHA1:
3
- metadata.gz: 7d699b8de5df4bf4aa1f1033562686f1ee419bca
4
- data.tar.gz: 550b2de454ca6a4971690b75d7cd6a8c6e0f460d
3
+ metadata.gz: 166255b7792cfb6e2692c28ecd819874eecec4b5
4
+ data.tar.gz: c12c7574df507268a02c86b87924a9d7bea0c405
5
5
  SHA512:
6
- metadata.gz: 007316cffbaeb575aad0ee56c17dec8ac5caf817df6b875e8747eacae4063d2d4c67424271ab0c4916a6d23badd4e338fe8bd12574189510a79f2214d07c186c
7
- data.tar.gz: a11900b252d0c3ee6a5d24aeff26a6206dd0d04604b49740192549fb6b5bfde5ce79bd76ea8297be5b0c0a34e45c60ce9b03d03260e8d526707fef90735cca2a
6
+ metadata.gz: 3a6252fe2dcd04eda59a758bcf3959068bc466cab12d8794f04f95a91db2a8c6f76bbf8f38003459082be7a36ed708283a20281974c6a439b21f51dac08c22ec
7
+ data.tar.gz: 1ed5e64c259493d2321aebd7298da66a5b02952740942c9aa5b5edfe65596def5777443700d5ce2e0c4142cb8bd42007afff280f84a5673f5c7f9a283f9ee57f
@@ -9,6 +9,7 @@ module Ione
9
9
  @host = host
10
10
  @port = port
11
11
  @state = :connecting
12
+ @lock = Mutex.new
12
13
  @closed_promise = Promise.new
13
14
  end
14
15
 
@@ -16,7 +17,10 @@ module Ione
16
17
  #
17
18
  # @return [true, false] returns false if the connection was already closed
18
19
  def close(cause=nil)
19
- return false if @state == :closed
20
+ @lock.synchronize do
21
+ return false if @state == :closed
22
+ @state = :closed
23
+ end
20
24
  if @io
21
25
  begin
22
26
  @io.close
@@ -25,7 +29,6 @@ module Ione
25
29
  # nothing to do, the socket was most likely already closed
26
30
  end
27
31
  end
28
- @state = :closed
29
32
  if cause
30
33
  @closed_promise.fail(cause)
31
34
  else
@@ -14,7 +14,6 @@ module Ione
14
14
  @unblocker = unblocker
15
15
  @clock = clock
16
16
  @socket_impl = socket_impl
17
- @lock = Mutex.new
18
17
  @write_buffer = ByteBuffer.new
19
18
  @connected_promise = Promise.new
20
19
  on_closed(&method(:cleanup_on_close))
@@ -8,7 +8,6 @@ module Ione
8
8
  super(host, port)
9
9
  @io = socket
10
10
  @unblocker = unblocker
11
- @lock = Mutex.new
12
11
  @write_buffer = ByteBuffer.new
13
12
  @state = :connected
14
13
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Ione
4
- VERSION = '1.1.3'.freeze
4
+ VERSION = '1.1.4'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ione
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-21 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Reactive programming framework for Ruby, painless evented IO, futures
14
14
  and an efficient byte buffer
@@ -18,7 +18,7 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - .yardopts
21
+ - ".yardopts"
22
22
  - README.md
23
23
  - lib/ione.rb
24
24
  - lib/ione/byte_buffer.rb
@@ -51,17 +51,17 @@ require_paths:
51
51
  - lib
52
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.9.3
57
57
  required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.2.1
64
+ rubygems_version: 2.2.2
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Reactive programming framework for Ruby