celluloid-io 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.12.0
2
+ ------
3
+ * Tracking release for Celluloid 0.12.0
4
+
1
5
  0.11.0
2
6
  ------
3
7
  * "Unofficial" SSL support (via nio4r 0.4.0)
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source :rubygems
2
2
 
3
- #gem 'celluloid', :git => 'git://github.com/celluloid/celluloid'
3
+ gem 'celluloid', :git => 'git://github.com/celluloid/celluloid'
4
4
 
5
5
  # Specify your gem's dependencies in celluloid-io.gemspec
6
6
  gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Celluloid::IO::VERSION
17
17
 
18
- gem.add_dependency 'celluloid', '~> 0.11.0'
18
+ gem.add_dependency 'celluloid', '~> 0.12.0'
19
19
  gem.add_dependency 'nio4r', '>= 0.4.0'
20
20
 
21
21
  gem.add_development_dependency 'rake'
@@ -10,12 +10,12 @@ class EchoClient
10
10
  def initialize(host, port)
11
11
  puts "*** Connecting to echo server on #{host}:#{port}"
12
12
 
13
- @socket = TCPSocket.from_ruby_socket(::TCPSocket.new(host, port))
13
+ # This is actually creating a Celluloid::IO::TCPSocket
14
+ @socket = TCPSocket.new(host, port)
14
15
  end
15
16
 
16
17
  def echo(s)
17
18
  @socket.write(s)
18
- actor = Celluloid.current_actor
19
19
  @socket.readpartial(4096)
20
20
  end
21
21
 
@@ -39,7 +39,8 @@ module Celluloid
39
39
  else raise ArgumentError, "invalid ownership type: #{type}"
40
40
  end
41
41
 
42
- Actor.current.wait(self) while instance_variable_get(ivar)
42
+ # Celluloid needs a better API here o_O
43
+ Thread.current[:actor].wait(self) while instance_variable_get(ivar)
43
44
  instance_variable_set(ivar, Task.current)
44
45
  end
45
46
 
@@ -58,7 +59,7 @@ module Celluloid
58
59
 
59
60
  raise "not owner" unless instance_variable_get(ivar) == Task.current
60
61
  instance_variable_set(ivar, nil)
61
- Actor.current.signal(self)
62
+ Thread.current[:actor].signal(self)
62
63
  end
63
64
 
64
65
  def read(length = nil, buffer = nil)
@@ -18,7 +18,8 @@ module Celluloid
18
18
  def self.nameservers(config = RESOLV_CONF)
19
19
  File.read(config).scan(/^\s*nameserver\s+([0-9.:]+)/).flatten
20
20
  end
21
-
21
+
22
+ # FIXME: Y U NO Resolv::Hosts?
22
23
  def self.hosts(hostfile = HOSTS)
23
24
  hosts = {}
24
25
  File.open(hostfile) do |f|
@@ -14,26 +14,22 @@ module Celluloid
14
14
  def <<(message)
15
15
  @mutex.lock
16
16
  begin
17
- @messages << message
18
- current_actor = Thread.current[:actor]
19
- @reactor.wakeup unless current_actor && current_actor.mailbox == self
20
- rescue IOError
21
- raise MailboxError, "dead recipient"
22
- ensure
23
- @mutex.unlock rescue nil
24
- end
25
- nil
26
- end
17
+ if message.is_a?(SystemEvent)
18
+ # Silently swallow system events sent to dead actors
19
+ return if @dead
27
20
 
28
- # Add a high-priority system event to the Mailbox
29
- def system_event(event)
30
- @mutex.lock
31
- begin
32
- @messages.unshift event
21
+ # SystemEvents are high priority messages so they get added to the
22
+ # head of our message queue instead of the end
23
+ @messages.unshift message
24
+ else
25
+ raise MailboxError, "dead recipient" if @dead
26
+ @messages << message
27
+ end
28
+
33
29
  current_actor = Thread.current[:actor]
34
30
  @reactor.wakeup unless current_actor && current_actor.mailbox == self
35
31
  rescue IOError
36
- # Silently fail if messages are sent to dead actors
32
+ raise MailboxError, "dead recipient"
37
33
  ensure
38
34
  @mutex.unlock rescue nil
39
35
  end
@@ -1,5 +1,5 @@
1
1
  module Celluloid
2
2
  module IO
3
- VERSION = "0.11.0"
3
+ VERSION = "0.12.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: celluloid-io
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.11.0
4
+ version: 0.12.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tony Arcieri
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-19 00:00:00.000000000Z
12
+ date: 2012-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: celluloid
16
- version_requirements: &2056 !ruby/object:Gem::Requirement
16
+ requirement: &70112015206080 !ruby/object:Gem::Requirement
17
+ none: false
17
18
  requirements:
18
19
  - - ~>
19
20
  - !ruby/object:Gem::Version
20
- version: 0.11.0
21
- none: false
22
- requirement: *2056
23
- prerelease: false
21
+ version: 0.12.0
24
22
  type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70112015206080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nio4r
27
- version_requirements: &2074 !ruby/object:Gem::Requirement
27
+ requirement: &70112015221200 !ruby/object:Gem::Requirement
28
+ none: false
28
29
  requirements:
29
30
  - - ! '>='
30
31
  - !ruby/object:Gem::Version
31
32
  version: 0.4.0
32
- none: false
33
- requirement: *2074
34
- prerelease: false
35
33
  type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70112015221200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- version_requirements: &2090 !ruby/object:Gem::Requirement
38
+ requirement: &70112015220460 !ruby/object:Gem::Requirement
39
+ none: false
39
40
  requirements:
40
41
  - - ! '>='
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
- none: false
44
- requirement: *2090
45
- prerelease: false
46
44
  type: :development
45
+ prerelease: false
46
+ version_requirements: *70112015220460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- version_requirements: &2108 !ruby/object:Gem::Requirement
49
+ requirement: &70112015219920 !ruby/object:Gem::Requirement
50
+ none: false
50
51
  requirements:
51
52
  - - ! '>='
52
53
  - !ruby/object:Gem::Version
53
54
  version: '0'
54
- none: false
55
- requirement: *2108
56
- prerelease: false
57
55
  type: :development
56
+ prerelease: false
57
+ version_requirements: *70112015219920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: benchmark_suite
60
- version_requirements: &2124 !ruby/object:Gem::Requirement
60
+ requirement: &70112015219060 !ruby/object:Gem::Requirement
61
+ none: false
61
62
  requirements:
62
63
  - - ! '>='
63
64
  - !ruby/object:Gem::Version
64
65
  version: '0'
65
- none: false
66
- requirement: *2124
67
- prerelease: false
68
66
  type: :development
67
+ prerelease: false
68
+ version_requirements: *70112015219060
69
69
  description: Evented IO for Celluloid actors
70
70
  email:
71
71
  - tony.arcieri@gmail.com
@@ -106,28 +106,29 @@ files:
106
106
  - tasks/rspec.task
107
107
  homepage: http://github.com/celluloid/celluloid-io
108
108
  licenses: []
109
- post_install_message:
109
+ post_install_message:
110
110
  rdoc_options: []
111
111
  require_paths:
112
112
  - lib
113
113
  required_ruby_version: !ruby/object:Gem::Requirement
114
+ none: false
114
115
  requirements:
115
116
  - - ! '>='
116
117
  - !ruby/object:Gem::Version
117
118
  version: '0'
118
- none: false
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
+ none: false
120
121
  requirements:
121
122
  - - ! '>='
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
- none: false
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 1.8.15
128
- signing_key:
126
+ rubyforge_project:
127
+ rubygems_version: 1.8.10
128
+ signing_key:
129
129
  specification_version: 3
130
- summary: Celluloid::IO allows you to monitor multiple IO objects within a Celluloid actor
130
+ summary: Celluloid::IO allows you to monitor multiple IO objects within a Celluloid
131
+ actor
131
132
  test_files:
132
133
  - spec/celluloid/io/actor_spec.rb
133
134
  - spec/celluloid/io/dns_resolver_spec.rb
@@ -136,4 +137,4 @@ test_files:
136
137
  - spec/celluloid/io/tcp_socket_spec.rb
137
138
  - spec/celluloid/io/udp_socket_spec.rb
138
139
  - spec/spec_helper.rb
139
- ...
140
+ has_rdoc: