oldmoe-reactor 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/reactor.rb +3 -1
- data/reactor.gemspec +2 -2
- metadata +2 -2
data/lib/reactor.rb
CHANGED
@@ -2,6 +2,7 @@ $:.unshift File.expand_path(File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
require 'util'
|
4
4
|
require 'timer'
|
5
|
+
require 'thread'
|
5
6
|
|
6
7
|
module Reactor
|
7
8
|
# A small, fast, pure Ruby reactor library
|
@@ -49,7 +50,7 @@ module Reactor
|
|
49
50
|
def initialize
|
50
51
|
@selectables = {:read => {:dirty=> false, :ios => {}, :callbacks => {}, :io_list => []},
|
51
52
|
:write=> {:dirty=> false, :ios => {}, :callbacks => {}, :io_list => []}}
|
52
|
-
@next_procs, @timers, @running =
|
53
|
+
@next_procs, @timers, @running = Queue.new, [], false
|
53
54
|
end
|
54
55
|
|
55
56
|
# Starts the reactor loop
|
@@ -184,6 +185,7 @@ module Reactor
|
|
184
185
|
end
|
185
186
|
|
186
187
|
# Register a block to be called at the next reactor tick
|
188
|
+
# this particular method is thread safe
|
187
189
|
def next_tick &block
|
188
190
|
@next_procs << block
|
189
191
|
end
|
data/reactor.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "reactor"
|
3
|
-
s.version = "0.2.
|
4
|
-
s.date = "2009-07-
|
3
|
+
s.version = "0.2.2"
|
4
|
+
s.date = "2009-07-09"
|
5
5
|
s.summary = "A pure Ruby reactor library"
|
6
6
|
s.email = "oldmoe@gmail.com"
|
7
7
|
s.homepage = "http://github.com/oldmoe/reactor"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oldmoe-reactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Muhammad A. Ali
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|