mailbox 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/mailbox.rb +5 -1
- data/mailbox.gemspec +22 -30
- data/test/mailbox_test.rb +10 -0
- metadata +12 -23
- data/.gitignore +0 -8
data/VERSION.yml
CHANGED
data/lib/mailbox.rb
CHANGED
@@ -56,6 +56,10 @@ module Mailbox
|
|
56
56
|
__queue_counter__.get
|
57
57
|
end
|
58
58
|
|
59
|
+
def __thread_name__
|
60
|
+
@__thread_name__ ||= "#{self.class.name} #{self.object_id} Mailbox"
|
61
|
+
end
|
62
|
+
|
59
63
|
private
|
60
64
|
def self.included(base)
|
61
65
|
base.extend(Mailbox::ClassMethods)
|
@@ -80,7 +84,7 @@ module Mailbox
|
|
80
84
|
|
81
85
|
def __create_fiber__
|
82
86
|
return self.class.__fiber_factory__.create if self.class.__fiber_factory__
|
83
|
-
JRL::Fibers::ThreadFiber.new( JRL::RunnableExecutorImpl.new,
|
87
|
+
JRL::Fibers::ThreadFiber.new( JRL::RunnableExecutorImpl.new, __thread_name__, true )
|
84
88
|
end
|
85
89
|
|
86
90
|
def __started_fiber__
|
data/mailbox.gemspec
CHANGED
@@ -1,57 +1,49 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mailbox}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.7"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joel Friedman", "Patrick Farley"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-05-16}
|
13
13
|
s.description = %q{Mailbox is a JRuby module that simplifies concurrency and is backed by JVM threads.}
|
14
14
|
s.email = %q{asher.friedman@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"test/test_helper.rb"
|
19
|
+
"README",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION.yml",
|
22
|
+
"example/channel_based_log_example.rb",
|
23
|
+
"example/i_can_has_cheese_burger_example.rb",
|
24
|
+
"example/log_example.rb",
|
25
|
+
"example/parallel_each_example.rb",
|
26
|
+
"example/ping_pong_example.rb",
|
27
|
+
"lib/daemon_thread_factory.rb",
|
28
|
+
"lib/mailbox.rb",
|
29
|
+
"lib/synchronized.rb",
|
30
|
+
"mailbox.gemspec",
|
31
|
+
"mailbox.iml",
|
32
|
+
"mailbox.ipr",
|
33
|
+
"test/mailbox_test.rb",
|
34
|
+
"test/synchronized_test.rb",
|
35
|
+
"test/test_helper.rb"
|
37
36
|
]
|
38
37
|
s.homepage = %q{http://joelash.github.com/mailbox}
|
39
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
40
38
|
s.require_paths = ["lib"]
|
41
39
|
s.rubyforge_project = %q{mailbox}
|
42
|
-
s.rubygems_version = %q{1.
|
40
|
+
s.rubygems_version = %q{1.5.1}
|
43
41
|
s.summary = %q{Mailbox is a JRuby module that simplifies concurrency and is backed by JVM threads.}
|
44
|
-
s.test_files = [
|
45
|
-
"test/mailbox_test.rb",
|
46
|
-
"test/synchronized_test.rb",
|
47
|
-
"test/test_helper.rb"
|
48
|
-
]
|
49
42
|
|
50
43
|
if s.respond_to? :specification_version then
|
51
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
52
44
|
s.specification_version = 3
|
53
45
|
|
54
|
-
if Gem::Version.new(Gem::
|
46
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
47
|
s.add_runtime_dependency(%q<jretlang>, [">= 0"])
|
56
48
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
57
49
|
else
|
data/test/mailbox_test.rb
CHANGED
@@ -356,6 +356,16 @@ class MailboxTest < Test::Unit::TestCase
|
|
356
356
|
assert_equal expected, test_agent.msg_info
|
357
357
|
end
|
358
358
|
|
359
|
+
class NamedMailbox
|
360
|
+
include Mailbox
|
361
|
+
end
|
362
|
+
|
363
|
+
def test_thread_name
|
364
|
+
box = NamedMailbox.new
|
365
|
+
|
366
|
+
assert_equal "MailboxTest::NamedMailbox #{box.object_id} Mailbox", box.__thread_name__
|
367
|
+
end
|
368
|
+
|
359
369
|
def test_dispose
|
360
370
|
klass = Class.new do
|
361
371
|
include Mailbox
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 6
|
9
|
-
version: 0.2.6
|
4
|
+
prerelease:
|
5
|
+
version: 0.2.7
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- Joel Friedman
|
@@ -15,18 +11,17 @@ autorequire:
|
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
13
|
|
18
|
-
date: 2011-
|
14
|
+
date: 2011-05-16 00:00:00 -05:00
|
19
15
|
default_executable:
|
20
16
|
dependencies:
|
21
17
|
- !ruby/object:Gem::Dependency
|
22
18
|
name: jretlang
|
23
19
|
prerelease: false
|
24
20
|
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
25
22
|
requirements:
|
26
23
|
- - ">="
|
27
24
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
25
|
version: "0"
|
31
26
|
type: :runtime
|
32
27
|
version_requirements: *id001
|
@@ -34,11 +29,10 @@ dependencies:
|
|
34
29
|
name: jeweler
|
35
30
|
prerelease: false
|
36
31
|
requirement: &id002 !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
37
33
|
requirements:
|
38
34
|
- - ">="
|
39
35
|
- !ruby/object:Gem::Version
|
40
|
-
segments:
|
41
|
-
- 0
|
42
36
|
version: "0"
|
43
37
|
type: :development
|
44
38
|
version_requirements: *id002
|
@@ -51,7 +45,6 @@ extensions: []
|
|
51
45
|
extra_rdoc_files:
|
52
46
|
- README
|
53
47
|
files:
|
54
|
-
- .gitignore
|
55
48
|
- README
|
56
49
|
- Rakefile
|
57
50
|
- VERSION.yml
|
@@ -74,32 +67,28 @@ homepage: http://joelash.github.com/mailbox
|
|
74
67
|
licenses: []
|
75
68
|
|
76
69
|
post_install_message:
|
77
|
-
rdoc_options:
|
78
|
-
|
70
|
+
rdoc_options: []
|
71
|
+
|
79
72
|
require_paths:
|
80
73
|
- lib
|
81
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
82
76
|
requirements:
|
83
77
|
- - ">="
|
84
78
|
- !ruby/object:Gem::Version
|
85
|
-
segments:
|
86
|
-
- 0
|
87
79
|
version: "0"
|
88
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
89
82
|
requirements:
|
90
83
|
- - ">="
|
91
84
|
- !ruby/object:Gem::Version
|
92
|
-
segments:
|
93
|
-
- 0
|
94
85
|
version: "0"
|
95
86
|
requirements: []
|
96
87
|
|
97
88
|
rubyforge_project: mailbox
|
98
|
-
rubygems_version: 1.
|
89
|
+
rubygems_version: 1.5.1
|
99
90
|
signing_key:
|
100
91
|
specification_version: 3
|
101
92
|
summary: Mailbox is a JRuby module that simplifies concurrency and is backed by JVM threads.
|
102
|
-
test_files:
|
103
|
-
|
104
|
-
- test/synchronized_test.rb
|
105
|
-
- test/test_helper.rb
|
93
|
+
test_files: []
|
94
|
+
|