ichannel 5.1.1.3 → 5.1.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == v5.1.1.4
2
+ * doc improvements
3
+ another release focused on doc improvements.
4
+
1
5
  == v5.1.1.3
2
6
  * doc improvements
3
7
  another and (hopefully) last set of changes to the documentation.
data/README.md CHANGED
@@ -12,10 +12,10 @@ __OVERVIEW__
12
12
  __DESCRIPTION__
13
13
 
14
14
  ichannel simplifies interprocess communication by providing a bi-directional
15
- channel that can transport ruby objects between processes on the same machine.
16
- All communication on a channel occurs on a streamed UNIXSocket that a channel
17
- uses to queues its messages (ruby objects), and also to ensure that messages
18
- are received in the order they are sent.
15
+ channel that can be used to transport ruby objects between processes on the same
16
+ machine. All communication on a channel occurs on a streamed UNIXSocket that a
17
+ channel uses to queues its messages (ruby objects), and also to ensure that
18
+ messages are received in the order they are sent.
19
19
 
20
20
  __SERIALIZATION__
21
21
 
@@ -46,6 +46,23 @@ channel.get # => 'Hello!'
46
46
 
47
47
  __2.__
48
48
 
49
+ Knowing when a channel is readable can be useful so that you can avoid a
50
+ blocking read. This (bad) example demonstrates how to do that:
51
+
52
+ ```ruby
53
+ channel = IChannel.new Marshal
54
+ pid = fork do
55
+ sleep 3
56
+ channel.put 42
57
+ end
58
+ until channel.readable?
59
+ sleep 1
60
+ channel.get # => 42
61
+ end
62
+ ```
63
+
64
+ __3.__
65
+
49
66
  MessagePack doesn't implement `dump` or `load` but a wrapper can be easily
50
67
  written:
51
68
 
@@ -1,3 +1,3 @@
1
1
  class IChannel
2
- VERSION = "5.1.1.3"
2
+ VERSION = "5.1.1.4"
3
3
  end
data/lib/ichannel.rb CHANGED
@@ -133,7 +133,7 @@ class IChannel
133
133
  # Returns true when the channel is readable.
134
134
  #
135
135
  def readable?
136
- if @reader.closed?
136
+ if closed?
137
137
  false
138
138
  else
139
139
  readable, _ = IO.select [@reader], nil, nil, 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ichannel
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1.3
4
+ version: 5.1.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -46,7 +46,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
46
  version: '0'
47
47
  segments:
48
48
  - 0
49
- hash: -738845943245247056
49
+ hash: -3132810581347906708
50
50
  required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  segments:
57
57
  - 0
58
- hash: -738845943245247056
58
+ hash: -3132810581347906708
59
59
  requirements: []
60
60
  rubyforge_project:
61
61
  rubygems_version: 1.8.23