ichannel 4.1.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.txt CHANGED
@@ -1,3 +1,16 @@
1
+ == v5.0.0
2
+ * Remove IChannel#empty?
3
+
4
+ I think the #readable? method is all you need, since the inverse of
5
+ #readable? is the same as #empty? (at least in terms of logic).
6
+
7
+ == v4.1.0
8
+ * Add IChannel#readable?
9
+
10
+ A method that can tell you whether or not a read would block.
11
+ When it returns true, a read shouldn't block, on the other hand
12
+ if it were false it'd likely block by the time you call #get.
13
+
1
14
  == v4.0.0
2
15
  * Modify IChannel#empty?
3
16
 
data/README.md CHANGED
@@ -67,7 +67,7 @@ can be passed as a serializer to IChannel.
67
67
 
68
68
  __REAL WORLD EXAMPLES__
69
69
 
70
- I am using IChannel in a couple of my own personal projects:
70
+ I am using IChannel in a couple of my own personal projects:
71
71
 
72
72
  - [IProcess](https://github.com/robgleeson/iprocess)
73
73
  Provides a number of abstractions on top of spawning subprocesses and
@@ -75,8 +75,14 @@ __REAL WORLD EXAMPLES__
75
75
  extracted into its own project when I realised it could be useful on its
76
76
  own.
77
77
 
78
- - [XPool](https://github.com/robgleeson/xpool)
79
- A UNIX(X) Process Pool.
78
+ - [xpool](https://github.com/robgleeson/xpool)
79
+ A lightweight UNIX(X) process pool implementation.
80
+
81
+
82
+ Other people have started to write code on top of ichannel, too:
83
+
84
+ - [ifuture](https://github.com/Havenwood/ifuture)
85
+ An implementation of Futures for Ruby using process forks and ichannel.
80
86
 
81
87
  __PLATFORM SUPPORT__
82
88
 
@@ -1,3 +1,3 @@
1
1
  class IChannel
2
- VERSION = "4.1.0"
2
+ VERSION = "5.0.0"
3
3
  end
data/lib/ichannel.rb CHANGED
@@ -126,21 +126,14 @@ class IChannel
126
126
 
127
127
  #
128
128
  # @return [Boolean]
129
- # Returns true when the channel is empty (nothing to read).
129
+ # Returns true when the channel is readable.
130
130
  #
131
- def empty?
131
+ def readable?
132
132
  if @reader.closed?
133
- true
133
+ false
134
134
  else
135
- ! IO.select [@reader], nil, nil, 0.1
135
+ readable = IO.select [@reader], nil, nil, 0.1
136
+ !! readable
136
137
  end
137
138
  end
138
-
139
- #
140
- # @return [Boolean]
141
- # Returns true when the channel is readable.
142
- #
143
- def readable?
144
- ! empty?
145
- end
146
139
  end
@@ -40,27 +40,6 @@ class IChannelTest < Test::Unit::TestCase
40
40
  assert_equal %w(b), @channel.get
41
41
  end
42
42
 
43
- def test_empty_on_empty_channel
44
- assert @channel.empty?
45
- end
46
-
47
- def test_empty_on_populated_channel
48
- @channel.put %w(a)
49
- refute @channel.empty?
50
- end
51
-
52
- def test_empty_on_emptied_channel
53
- @channel.put %w(a)
54
- @channel.get
55
- assert @channel.empty?
56
- end
57
-
58
- def test_empty_on_closed_channel
59
- @channel.put %w(a)
60
- @channel.close
61
- assert @channel.empty?
62
- end
63
-
64
43
  def test_readable_on_populated_channel
65
44
  @channel.put %w(a)
66
45
  @channel.put %w(b)
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: 4.1.0
4
+ version: 5.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-30 00:00:00.000000000 Z
12
+ date: 2012-12-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! "A modern and easy-to-use interprocess communication \n primitive."
15
15
  email:
@@ -45,7 +45,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
45
  version: '0'
46
46
  segments:
47
47
  - 0
48
- hash: -2586476710676895974
48
+ hash: -2692349737197848980
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: -2586476710676895974
57
+ hash: -2692349737197848980
58
58
  requirements: []
59
59
  rubyforge_project:
60
60
  rubygems_version: 1.8.23