celluloid 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/celluloid/actor.rb +1 -1
- data/lib/celluloid/fiber.rb +2 -2
- data/lib/celluloid/task.rb +1 -1
- data/lib/celluloid/version.rb +1 -1
- data/spec/support/actor_examples.rb +2 -0
- metadata +7 -8
- data/lib/celluloid/tcp_server.rb +0 -33
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Celluloid
|
2
2
|
=========
|
3
|
-
[![Build Status](http://travis-ci.org/tarcieri/celluloid.png)](http://travis-ci.org/tarcieri/celluloid)
|
3
|
+
[![Build Status](http://travis-ci.org/tarcieri/celluloid.png)](http://travis-ci.org/tarcieri/celluloid) [![Dependency Status](https://gemnasium.com/tarcieri/celluloid.png)](https://gemnasium.com/tarcieri/celluloid)
|
4
4
|
|
5
5
|
> "I thought of objects being like biological cells and/or individual
|
6
6
|
> computers on a network, only able to communicate with messages"
|
data/lib/celluloid/actor.rb
CHANGED
data/lib/celluloid/fiber.rb
CHANGED
@@ -8,7 +8,7 @@ rescue LoadError => ex
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# Fibers are broken on JRuby 1.6.5. This works around the issue
|
11
|
-
if JRUBY_VERSION
|
11
|
+
if JRUBY_VERSION[/^1\.6\.5/]
|
12
12
|
require 'jruby'
|
13
13
|
org.jruby.ext.fiber.FiberExtLibrary.new.load(JRuby.runtime, false)
|
14
14
|
class org::jruby::ext::fiber::ThreadFiber
|
@@ -30,4 +30,4 @@ rescue LoadError => ex
|
|
30
30
|
else
|
31
31
|
raise ex
|
32
32
|
end
|
33
|
-
end
|
33
|
+
end
|
data/lib/celluloid/task.rb
CHANGED
data/lib/celluloid/version.rb
CHANGED
@@ -136,6 +136,7 @@ shared_context "a Celluloid Actor" do |included_module|
|
|
136
136
|
it "inspects properly" do
|
137
137
|
actor = actor_class.new "Troy McClure"
|
138
138
|
actor.inspect.should match(/Celluloid::Actor\(/)
|
139
|
+
actor.inspect.should match(/#{actor_class}/)
|
139
140
|
actor.inspect.should include('@name="Troy McClure"')
|
140
141
|
actor.inspect.should_not include("@celluloid")
|
141
142
|
end
|
@@ -144,6 +145,7 @@ shared_context "a Celluloid Actor" do |included_module|
|
|
144
145
|
actor = actor_class.new "Troy McClure"
|
145
146
|
actor.terminate
|
146
147
|
actor.inspect.should match(/Celluloid::Actor\(/)
|
148
|
+
actor.inspect.should match(/#{actor_class}/)
|
147
149
|
actor.inspect.should include('dead')
|
148
150
|
end
|
149
151
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: celluloid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70197910788100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,18 +21,18 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70197910788100
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70197910787320 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
|
-
- -
|
30
|
+
- - ~>
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.7.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70197910787320
|
36
36
|
description: Celluloid is a concurrent object framework inspired by the Actor Model
|
37
37
|
email:
|
38
38
|
- tony@medioh.com
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- lib/celluloid/signals.rb
|
62
62
|
- lib/celluloid/supervisor.rb
|
63
63
|
- lib/celluloid/task.rb
|
64
|
-
- lib/celluloid/tcp_server.rb
|
65
64
|
- lib/celluloid/timers.rb
|
66
65
|
- lib/celluloid/version.rb
|
67
66
|
- lib/celluloid.rb
|
data/lib/celluloid/tcp_server.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'socket'
|
2
|
-
|
3
|
-
module Celluloid
|
4
|
-
# A TCPServer that runs as an actor
|
5
|
-
class TCPServer
|
6
|
-
include Celluloid::IO
|
7
|
-
|
8
|
-
# Bind a TCP server to the given host and port
|
9
|
-
def initialize(host, port)
|
10
|
-
@server = ::TCPServer.new host, port
|
11
|
-
run!
|
12
|
-
end
|
13
|
-
|
14
|
-
# Run the TCP server event loop
|
15
|
-
def run
|
16
|
-
while true
|
17
|
-
wait_readable(@server)
|
18
|
-
on_connect @server.accept
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
# Terminate this server
|
23
|
-
def terminate
|
24
|
-
@server.close
|
25
|
-
super
|
26
|
-
end
|
27
|
-
|
28
|
-
# Called whenever a new connection is opened
|
29
|
-
def on_connect(connection)
|
30
|
-
connection.close
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|