rakie 0.0.5 → 0.0.6

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: 754086391c9ec9e2eb623d8d6a1ead9ca9188d49fb0c391b26c4a9e36db88236
4
- data.tar.gz: 6ac34e0868c8bc1748e7f572266b4223a91f676d9d7c11b22fa5a7e10586713c
3
+ metadata.gz: 6aa5c872ec3bdf47d4f33f08f12f6ba6c3521553c9411c284d01b5efc6a63431
4
+ data.tar.gz: 0ed904078c4aa1bdbf6d9564be3b381a5ae6ca1c2831256c2fadff5cd449c81d
5
5
  SHA512:
6
- metadata.gz: 839acbd5155b745948a6144a37480b770e50f01ff4daf29146e39c8fb2e36cf0f434f10313577d3f7b1efcfd039317b036d9c87f96d6c57d09a25c9da6ba5e10
7
- data.tar.gz: a844de019fa10103c96e7cc7ab4f7e78ffb2cd5a7c23b28be6483c35fbb7a5cfd1b51f4a1996fa053fa33e03d701af52682c0af306d92b3f2c2c98878aa7c4c6
6
+ metadata.gz: 80823efc97c0d28c64d0871149118a5df0bebd19623a7b7088b9831218e8e0cee8e8a32901a010af3ffdb5e24ce86d5892dac8f5638541427e151e60209738c2
7
+ data.tar.gz: 9c747c282c958a45b307eba5e9bf451f513c8337106a4c1aaf59b8b6b4809ce915607e91ca544af48149b9faa7418041fea03adf6fca06580014bd1c51765308
data/lib/rakie/channel.rb CHANGED
@@ -20,7 +20,10 @@ module Rakie
20
20
  end
21
21
 
22
22
  rescue IO::EAGAINWaitReadable
23
- Log.debug("Channel read finished")
23
+ Log.debug("Channel read pending")
24
+
25
+ rescue IO::EWOULDBLOCKWaitReadable
26
+ Log.debug("Channel read pending")
24
27
 
25
28
  rescue Exception => e
26
29
  # Process the last message on exception
@@ -67,19 +70,27 @@ module Rakie
67
70
 
68
71
  def on_write(io)
69
72
  len = 0
73
+ offset = 0
70
74
 
71
75
  begin
72
76
  while @write_buffer.length > 0
73
77
  len = io.write_nonblock(@write_buffer)
78
+ offset += len
74
79
  @write_buffer = @write_buffer[len .. -1]
75
80
  end
76
81
 
77
82
  Log.debug("Channel write finished")
78
83
 
79
84
  rescue IO::EAGAINWaitWritable
80
- self.handle_write(len)
85
+ self.handle_write(offset)
86
+
87
+ Log.debug("Channel write pending")
88
+ return Event::HANDLE_CONTINUED
89
+
90
+ rescue IO::EWOULDBLOCKWaitWritable
91
+ self.handle_write(offset)
81
92
 
82
- Log.debug("Channel write continue")
93
+ Log.debug("Channel write pending")
83
94
  return Event::HANDLE_CONTINUED
84
95
 
85
96
  rescue
@@ -87,7 +98,7 @@ module Rakie
87
98
  return Event::HANDLE_FAILED
88
99
  end
89
100
 
90
- self.handle_write(len)
101
+ self.handle_write(offset)
91
102
 
92
103
  return Event::HANDLE_FINISHED
93
104
  end
data/lib/rakie/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Rakie
2
- VERSION = [0, 0, 5]
2
+ VERSION = [0, 0, 6]
3
3
 
4
4
  def self.version_s
5
5
  VERSION.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakit Liang
@@ -43,9 +43,9 @@ require_paths:
43
43
  - lib
44
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - ">"
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: '2.5'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="