Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread local propagation #125

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
368 commits
Select commit Hold shift + click to select a range
461b4a9
Better delegation for Celluloid::PoolManager
tarcieri Jun 12, 2012
1abbbd7
Combinatorial explosion of the matrix o_O
tarcieri Jun 12, 2012
d7d1c77
Huuuurk @ rbx
tarcieri Jun 12, 2012
a8646d7
Merge remote-tracking branch 'upstream/master' into clear_registry
slyphon Jun 13, 2012
51b86c9
actually assert the registry is empty
slyphon Jun 13, 2012
011db4a
Merge pull request #47 from motionbox/clear_registry
tarcieri Jun 13, 2012
499a2f6
Synchronize ActorProxy#terminate with #join
tarcieri Jun 19, 2012
82ce9fd
Add notifications for actors
grantr Jun 22, 2012
1a1d6a3
test unsubscribe
grantr Jun 22, 2012
b67a04f
prune subscriptions from dead actors
grantr Jun 22, 2012
5affff6
make fanout notifier an actor
grantr Jun 22, 2012
44eb77f
don't require a reason to prune
grantr Jun 22, 2012
aff2248
Added a failling test on Celluloid::Notification.
Jun 23, 2012
8d01446
Fix pattern on Celluloid::Notification.
Jun 23, 2012
3203e4c
Remove freenode token
tarcieri Jun 23, 2012
e1c9049
Merge pull request #1 from chatgris/notifications
grantr Jun 23, 2012
16e3876
Return the actor for Celluloid::SupervisionGroup::Member#start
halorgium Jun 23, 2012
96759b2
Unify the Supervisor and SupervisionGroup classes
halorgium Jun 23, 2012
75b22d2
Merge pull request #53 from halorgium/unify-supervisor-trees
tarcieri Jun 24, 2012
5e48db6
test multiple subscriptions
grantr Jun 24, 2012
f13edd5
disambiguate local vs instance variables
grantr Jun 24, 2012
5e4aedb
Fix supervision groups link in the README.
KL-7 Jun 26, 2012
4055849
Merge pull request #54 from KL-7/patch-1
tarcieri Jun 26, 2012
ed33496
Merge pull request #52 from grantr/notifications
tarcieri Jun 27, 2012
9298dd7
Move example actor class into a separate file
tarcieri Jun 30, 2012
ad678b1
'exclusive' class method
tarcieri Jun 30, 2012
0a6fb43
Do not require a caller for AsyncCall
halorgium Jun 30, 2012
317b8fc
Hide the task inside the Response object
halorgium Jun 30, 2012
80e936b
Merge pull request #56 from halorgium/fixes
tarcieri Jul 1, 2012
4175f4a
Move guard-rspec out of CI gems
halorgium Jul 11, 2012
0e9718b
Spec for thread count during pool execution
tarcieri Jul 14, 2012
d2930e8
Use the timers gem
tarcieri Jul 14, 2012
a49a480
Bump timers gem dependency
tarcieri Jul 14, 2012
576080f
Don't proxy the #class method
tarcieri Jul 14, 2012
8c8c682
Prevent SystemEvents from leaking out of #receive
tarcieri Jul 14, 2012
cd340b1
Update CHANGES
tarcieri Jul 14, 2012
ed32c5e
Bump timers dependency to 1.0.0.pre3
tarcieri Jul 14, 2012
0d9cc87
Bump timers dependency
tarcieri Jul 14, 2012
16440e7
Use Actor.all in pool spec
tarcieri Jul 14, 2012
41933c6
Use timers 1.0.0
tarcieri Jul 16, 2012
4ff10f0
Bump version to 0.11.1
tarcieri Jul 17, 2012
71175d9
Log the cause of aborted async calls
tarcieri Jul 21, 2012
9861fd5
SystemEvents are no longer exceptions
tarcieri Jul 21, 2012
f087b25
Eliminate Celluloid::Mailbox#system_event
tarcieri Jul 21, 2012
e865dd2
Visual cleanup
tarcieri Jul 21, 2012
a112fbe
Link with SystemEvents
tarcieri Jul 21, 2012
3304605
Unidirectional linking with #monitor and #unmonitor
tarcieri Jul 21, 2012
d606c4d
Handle system events properly when exclusive
tarcieri Jul 21, 2012
9f356cb
Don't process system messages during linking
tarcieri Jul 21, 2012
c0446a8
Linking overhaul
tarcieri Jul 22, 2012
e6ab522
Oops, leftover debugging stuffins
tarcieri Jul 22, 2012
b22c788
Delete ugly newline
tarcieri Jul 22, 2012
780f12d
Provide the always_exclusive class method to classes that mixin
alh13 Jul 23, 2012
1fb3a5c
[BUGFIX] Dependencies' examples need the example actor class
benlangfeld Jul 23, 2012
bf3a430
Per tarcieri, remove the always_exclusive method and instead trigger
alh13 Jul 23, 2012
adb670c
Merge pull request #59 from alh13/always_exclusive
tarcieri Jul 23, 2012
50fd0c2
Bump version to 0.12.0
tarcieri Jul 24, 2012
0ccdc79
Refactor always exclusive specs
tarcieri Jul 24, 2012
a8ad3f1
Initial use_mailbox specs
tarcieri Jul 24, 2012
a8ecaeb
Reduce sleep time for faster tests
tarcieri Jul 24, 2012
775ae0e
Use timer quantum for the sleep time
tarcieri Jul 24, 2012
b44ff91
Subclasses should retain custom mailboxes
tarcieri Jul 24, 2012
f28f593
Factor join and kill into class methods of Actor
tarcieri Jul 24, 2012
26300b5
Make ActorProxy a BasicObject
tarcieri Jul 24, 2012
8d21eb3
Changelog entry for #59
benlangfeld Jul 25, 2012
94b4987
Add missing parameter “include_private” to respond_to? for ActorProxy
Burgestrand Jul 26, 2012
1da485e
Merge pull request #62 from Burgestrand/respond_to_include_private
tarcieri Jul 30, 2012
757b165
Configurable Celluloid::Task types
tarcieri Aug 2, 2012
c352388
Fix redefined constant warnings in specs
tarcieri Aug 2, 2012
03abb26
Not sure why this was disabled on rbx
tarcieri Aug 2, 2012
1488ec7
Raise DeadActorError if notifier isn't running
tarcieri Aug 2, 2012
2c35648
Add some debug logging for Travis
tarcieri Aug 2, 2012
ef482ec
Fix some potential culprits for the failing specs
tarcieri Aug 2, 2012
88b88ee
More debug logging for Travis :(
tarcieri Aug 2, 2012
1f848ca
Revert "More debug logging for Travis :("
tarcieri Aug 2, 2012
ce05b79
Fix operation in exclusive :all mode
tarcieri Aug 2, 2012
d272a48
Changes
tarcieri Aug 2, 2012
4948ed4
All Celluloid methods are available through the singleton
tarcieri Aug 2, 2012
fdb2b24
Put TIMER_QUANTUM into the shared specs
tarcieri Aug 2, 2012
2eb1699
Rename events.rb to system_events.rb
tarcieri Aug 3, 2012
d784dd2
Log tests to log/test.log
tarcieri Aug 3, 2012
6eecbd8
Fix reference to legacy name
tarcieri Aug 5, 2012
4f90a3b
Remove legacy Celluloid::Group constant
tarcieri Aug 5, 2012
b6fd449
Add CPU pattern of Windows to CPU counter
tyabe Aug 10, 2012
45f74b4
Merge pull request #66 from tyabe/add_cpu_pattern
tarcieri Aug 10, 2012
5e993e4
use map for terminators - each returns the original array
JustinLove Aug 10, 2012
3a604dd
BasicObject doesn't even have raise
JustinLove Aug 10, 2012
762c565
backfill raise test
JustinLove Aug 10, 2012
a1230f3
Merge pull request #67 from JustinLove/raise
tarcieri Aug 11, 2012
9d93f42
Merge pull request #68 from JustinLove/map
tarcieri Aug 11, 2012
bf11117
fix undefined method value for nil error on jruby and rbx
JustinLove Aug 11, 2012
544bceb
Merge pull request #69 from JustinLove/nilvalue
tarcieri Aug 12, 2012
7a96e48
Impose 5 second timeout on linking
tarcieri Aug 13, 2012
853670e
Proper finalizer for Celluloid::PoolManager
tarcieri Aug 14, 2012
a000e8e
Remove #join and #kill from the actor proxy
tarcieri Aug 14, 2012
6281012
Fix terminate/kill specs
tarcieri Aug 14, 2012
f1c5b0a
Initial task specs
tarcieri Aug 14, 2012
f51aa7f
Marginally improved task specs
tarcieri Aug 15, 2012
b58b34e
Initial Celluloid::TaskThread
tarcieri Aug 15, 2012
5b711e8
Added second parameter to SupervisionGroup.pool method to pass option…
bsingr Aug 15, 2012
703f79b
Merge pull request #71 from dpree/master
tarcieri Aug 15, 2012
0e634d9
make the actor configuration an explicit options argument
JustinLove Aug 15, 2012
c91b1ea
Fixed bug in SupervisionGroup.pool argument passion (PoolManager expe…
bsingr Aug 15, 2012
cb5742d
Removed unnecessary stringification in SupervisionGroup.pool (this is…
bsingr Aug 15, 2012
395e0e4
Added capabilities to set pool size via SupervisionGroup.pool and enh…
bsingr Aug 15, 2012
f008303
Merge pull request #72 from dpree/master
tarcieri Aug 15, 2012
acd3578
Cells are actors too!
tarcieri Aug 16, 2012
2310534
Instructions for n00bs
tarcieri Aug 16, 2012
78fe863
How do I shot celluloid?
tarcieri Aug 16, 2012
8975187
Fix botched Task::TerminatedError constants
tarcieri Aug 16, 2012
d21e7da
Terminate linked actors even on clean exits
tarcieri Aug 16, 2012
eb73ef9
Remove dated joke ;)
tarcieri Aug 16, 2012
7be2014
Mark Celluloid::TaskThread specs as pending
tarcieri Aug 16, 2012
bea372d
Apparently I was confused about the Erlang behavior :|
tarcieri Aug 16, 2012
c95a528
Merge pull request #75 from JustinLove/actor_options
tarcieri Aug 16, 2012
3c06e76
Update logo
tarcieri Aug 16, 2012
a804061
Logo again!
tarcieri Aug 16, 2012
26059ab
Revert "Logo again!"
tarcieri Aug 16, 2012
c66f6b1
Use logo from celluloid-logos
tarcieri Aug 17, 2012
b9cb255
Celluloid::Registry#delete removes actors' name reference from regist…
jeremyvdw Aug 17, 2012
71cfae1
Added spec for Celluloid::Registry#delete method
jeremyvdw Aug 17, 2012
ecb98d5
Fixed typo in registry_spec
jeremyvdw Aug 17, 2012
2ce1a61
Merge pull request #76 from jeremyvdw/master
tarcieri Aug 17, 2012
243c58e
Shutdown without futures
JustinLove Aug 17, 2012
39ef271
Merge pull request #79 from JustinLove/shutdown_without_futures
tarcieri Aug 17, 2012
3cef01d
1.9.2 BasicObject does not include object_id, also hash was not retur…
JustinLove Aug 18, 2012
5c61f3f
Merge pull request #80 from JustinLove/basic_object_identity
tarcieri Aug 18, 2012
3404f29
Spec for #method behavior
tarcieri Aug 18, 2012
092c27e
Celluloid#method routes through the proxy
tarcieri Aug 18, 2012
000e236
added specs to describe Celluloid::Links
bsingr Aug 27, 2012
3b7e58f
removed unnecessary require statement from Celluloid::Links file
bsingr Aug 27, 2012
1091db6
Merge pull request #83 from dpree/master
tarcieri Aug 27, 2012
22dabd1
Remove links inspect spec that fails on JRuby
tarcieri Aug 27, 2012
02ba9c4
tmm1-inspired TaskThread implementation
tarcieri Sep 1, 2012
27b90ec
Celluloid::Future#ready?
tarcieri Sep 1, 2012
77d36cb
Bump to 0.12.0.pre
tarcieri Sep 1, 2012
5c44b60
Add Future#ready? to check if a future has a value or not
zerowidth Aug 30, 2012
02f7f43
Remove duplicate ready definition
tarcieri Sep 1, 2012
3d69940
Proper ordering of ThreadTask states
tarcieri Sep 2, 2012
e06390d
Minor visual cleanups
tarcieri Sep 2, 2012
1e48c9f
Required Ruby version: 1.9.2+
tarcieri Sep 2, 2012
946eeb8
Factor apart AbstractProxy, ActorProxy, and AsyncProxy
tarcieri Sep 3, 2012
1ac52fd
This has long since been fixed
tarcieri Sep 3, 2012
ad7f9ab
Celluloid::FutureProxy for future.method syntax
tarcieri Sep 3, 2012
c2d77a7
Note new async/future syntax in CHANGES
tarcieri Sep 3, 2012
cb8cc3e
Celluloid.mailbox_class for defining custom mailboxes
tarcieri Sep 3, 2012
f35462f
Mark TaskThreads as dead before resuming their callers
tarcieri Sep 3, 2012
96bfdef
Use a mutex/condition instead of a queue
tarcieri Sep 3, 2012
72e4427
Bump to 0.12.0.pre2
tarcieri Sep 3, 2012
a8fa551
Create AsyncProxy and FutureProxy instances AOT
tarcieri Sep 3, 2012
7d5246a
Retain custom task_class when subclassed
tarcieri Sep 3, 2012
1e4c6d9
Make async.method work within an actor
tarcieri Sep 3, 2012
768594f
Support future calls to self
tarcieri Sep 3, 2012
a00b162
Bump to 0.12.0.pre3
tarcieri Sep 3, 2012
68e0b27
Fix some wonky exception usage
tarcieri Sep 3, 2012
bffb9f3
Remove prerelease designation from version
tarcieri Sep 3, 2012
cf7f988
Use the Celluloid::TIMER_QUANTUM constant everywhere
tarcieri Sep 3, 2012
b3aa723
Celluloid::Actor#timeout -> #timeout_interval
tarcieri Sep 3, 2012
cc6738c
Bump version in CHANGES to 0.12.0
tarcieri Sep 4, 2012
ff996f4
Bump version of HEAD to 0.12.1
tarcieri Sep 4, 2012
9c1fa92
Remove Celluloid#alive?
tarcieri Sep 8, 2012
3af0db8
String inspect warnings for bare Celluloid objects
tarcieri Sep 8, 2012
21a4f0e
Make 'bare object' the canonical name for naked Celluloid objects
tarcieri Sep 8, 2012
631d359
Update basic usage to use new async syntax
tarcieri Sep 9, 2012
c9b39b2
Update async syntax in cigarette smokers example
tarcieri Sep 9, 2012
71c504b
Update future syntax in example
tarcieri Sep 9, 2012
74c1d56
Update future syntax in pool example
tarcieri Sep 9, 2012
79ef141
Update async syntax in ring example
tarcieri Sep 9, 2012
3a3a4eb
add RingBuffer for storing log messages
grantr Sep 11, 2012
5f41eb6
add RingBuffer#flush
grantr Sep 14, 2012
7be0614
add IncidentLogger and supporting classes
grantr Sep 14, 2012
3e5ea72
Undo BasicObject based ActorProxy change
benlangfeld Sep 14, 2012
27b7320
allow multiple prognames per logger
grantr Sep 14, 2012
3709299
publish to a progname topic
grantr Sep 14, 2012
f90eab8
use a Logger to write incident events
grantr Sep 14, 2012
5c25f1e
Event#time instead of #timestamp
grantr Sep 14, 2012
5018d99
pass args into wrapped Logger instance
grantr Sep 14, 2012
0dd2c23
use IncidentLogger as Celluloid.logger
grantr Sep 14, 2012
1efd8d5
[BUGFIX] Make pool size accessible
benlangfeld Sep 16, 2012
a483fd5
Merge pull request #90 from benlangfeld/master
tarcieri Sep 16, 2012
3b370ec
Disable rbx on travis due to fiber-related crash
tarcieri Sep 16, 2012
e84b527
Notes on reverting BasicObject proxies
tarcieri Sep 16, 2012
43589b3
Changes
tarcieri Sep 16, 2012
4b764b4
Notes on removing Celluloid#alive?
tarcieri Sep 16, 2012
34e3979
rename Event to LogEvent
grantr Sep 17, 2012
6c9d0fa
missed a rename
grantr Sep 17, 2012
1563a13
if logger doesn't respond to alive?, don't send it
grantr Sep 17, 2012
7b0c76b
make IncidentLogger a plain old ruby object
grantr Sep 17, 2012
6b3fc7b
allow triggering_event to be nil
grantr Sep 17, 2012
4d1ff84
return a new incident when merging
grantr Sep 17, 2012
c544ed3
merge more than two incidents together
grantr Sep 17, 2012
e52dcf1
add triggering event time to incident header
grantr Sep 17, 2012
bb79da6
add a fallback logger
grantr Sep 18, 2012
6deb1e9
add newlines to incident reports
grantr Sep 18, 2012
3ecf602
don't replace the celluloid logger in specs
grantr Sep 18, 2012
f8ec2ee
Allow failures on rbx and jruby-head
tarcieri Sep 18, 2012
b742ae2
Raise NotTaskError if task-related things are requested outside a task
tarcieri Sep 18, 2012
bf5ce9b
More idiomatic
tarcieri Sep 19, 2012
6328c9f
Use exclusive mode by default unless within a task
tarcieri Sep 19, 2012
bb9364b
workaround MRI bug in preserving exit status in at_exit
jrochkind Sep 19, 2012
0c32968
report incidents to a logfile in tests
grantr Sep 19, 2012
7824e06
add silence/unsilence to IncidentReporter
grantr Sep 19, 2012
7dba40a
Initial thread dump spike
tarcieri Sep 19, 2012
9c038df
Merge pull request #93 from jrochkind/workaround_mri_at_exit_bug
tarcieri Sep 20, 2012
5fc84e0
Improved stack dumper
tarcieri Sep 21, 2012
a250e77
Revert "Use exclusive mode by default unless within a task"
tarcieri Sep 21, 2012
28a5f4d
Set the proper task type
tarcieri Sep 21, 2012
04a2286
Changes!
tarcieri Sep 21, 2012
3633a87
publish incidents with async call
grantr Sep 22, 2012
c8a2187
no need to include Celluloid::Notifications
grantr Sep 22, 2012
ab9a599
publish to the correct incident topic
grantr Sep 22, 2012
cd8f976
Merge pull request #92 from grantr/logging
tarcieri Sep 22, 2012
a747b66
Count cores properly in AWS/Ubuntu
jmoses Oct 1, 2012
2121cdd
Merge pull request #98 from jmoses/master
tarcieri Oct 1, 2012
e3246ed
Use Facter for CPU count
jc00ke Oct 2, 2012
6ca69e6
Add test around FSM#transition
Oct 2, 2012
4af0890
Encapsulate the idea of "transitioning with callbacks" into a method
Oct 2, 2012
0f17368
Extra method refactoring
Oct 2, 2012
4cac889
Improve test coverage for FSM#transition
Oct 2, 2012
397cdaa
Extract out FSM state methods
Oct 2, 2012
822a1a0
The final extract method refactoring that tames the beast formerly known
Oct 2, 2012
46bb562
Merge pull request #99 from JoeyButler/refactor_fsm_transition
tarcieri Oct 5, 2012
f3642f2
Better logic for suspending via tasks
tarcieri Oct 10, 2012
38ab7ad
Ensure exclusive mode remains on in nested blocks
tarcieri Oct 10, 2012
00cfb17
Better logic for sleeping via a task
tarcieri Oct 10, 2012
92f3563
Bump version to 0.12.1.pre2
tarcieri Oct 10, 2012
17b4079
Bump to 0.12.1 (with CHANGES)
tarcieri Oct 10, 2012
b7a3af4
Disable the IncidentReporter by default
tarcieri Oct 10, 2012
c63e71e
Bump version to 0.12.2
tarcieri Oct 10, 2012
04fd97d
Make the exit handler an inheritable property
tarcieri Oct 16, 2012
6c1772f
Remove rbx and jruby from allowed failures
tarcieri Oct 16, 2012
f135337
Focus-fail
benlangfeld Oct 24, 2012
c21b9c4
Merge pull request #108 from celluloid/feature/broken_exclusive
tarcieri Oct 24, 2012
96b7f8b
[BUGFIX] Ensure exclusive mode works correctly for per-method case
benlangfeld Oct 24, 2012
636139e
Bump version to 0.12.3
tarcieri Oct 25, 2012
69922df
Log test output to a logfile
tarcieri Oct 25, 2012
702dd56
added proxy_class to switch actor proxy class
schmurfy Oct 14, 2012
a2e1bc3
Merge pull request #103 from schmurfy/use_proxy
tarcieri Oct 28, 2012
b61cb78
added rb-fsevent gem for guard on Mac OS X
schmurfy Oct 29, 2012
76313fb
added method name on call errors
schmurfy Oct 29, 2012
3a81ebc
Merge pull request #111 from schmurfy/guard_mac
halorgium Oct 29, 2012
1201e86
Emphasize the docs
tarcieri Oct 31, 2012
03f476e
Update Sidekiq URL
tarcieri Oct 31, 2012
41783f1
Trololol 'async' programming
tarcieri Oct 31, 2012
5cfa20a
Fix exclusive mode
tarcieri Nov 4, 2012
06edd8a
Merge pull request #110 from schmurfy/improved_call_error
tarcieri Nov 14, 2012
04f2820
Use debug loglevel for termination messages
tarcieri Nov 14, 2012
5af0a19
Improved debugging for fiber-related errors
tarcieri Nov 16, 2012
f07e038
API documentation
tarcieri Nov 16, 2012
ec83a2a
fix TaskWithThreadLocals, remove Task superclass
Nov 24, 2012
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .document
@@ -1,5 +1,5 @@
lib/**/*.rb
bin/*
-
-
features/**/*.feature
LICENSE.txt
4 changes: 2 additions & 2 deletions .rspec
@@ -1,4 +1,4 @@
--color
--format documentation
--color
--format documentation
--backtrace
--default_path spec
9 changes: 6 additions & 3 deletions .travis.yml
@@ -1,8 +1,11 @@
script: rake ci
bundler_args: --without custom
rvm:
- 1.9.2
- 1.9.3
- ruby-head
- jruby-19mode
- jruby-head
- rbx-18mode
- rbx-19mode
- rbx-19mode

notifications:
irc: "irc.freenode.org#celluloid"
84 changes: 84 additions & 0 deletions CHANGES.md
@@ -1,3 +1,87 @@
0.12.3
------
* Bugfix: Ensure exclusive mode works correctly for per-method case
* Bugfix: Exit handlers were not being inherited correctly

0.12.2
------
* Disable IncidentReporter by default

0.12.1
------
* Fix bug in unsetting of exclusive mode
* New incident report system for providing better debugging reports
* Revert BasicObject proxies for now... they are causing problems
* String inspect that reveals bare object leaks
* Fix bug reporting proper task statuses
* Initial thread dumper support
* Remove Celluloid#alive? as it cannot be called in any manner that will ever
return anything but true, rendering it useless
* Use Facter to get CPU count

0.12.0
------
* Alternative async syntax: actor.async.method in lieu of actor.method!
Original syntax still available but will be removed in Celluloid 1.0
* Alternative future syntax: actor.future.method in lieu of future(:method)
* All methods in the Celluloid module are now available on its singleton
* The #join and #kill methods are no longer available on the actor proxy.
Please use Celluloid::Actor.join(actor) and .kill(actor) instead.
* Celluloid::Future#ready? can be used to query for future readiness
* Celluloid::Group constant removed. Please use Celluloid::SupervisionGroup
* #monitor, #unmonitor, and #monitoring? provide unidirectional linking
* Linking is now performed via a SystemEvent
* SystemEvents are no longer exceptions. Boo exceptions as flow control!
* Celluloid::Mailbox#system_event eliminated and replaced with Mailbox#<<
SystemEvents are now automatically high priority
* The task_class class method can be used to override the class used for
tasks, allowing different task implementations to be configured on an
actor-by-actor-basis
* Celluloid::TaskThread provides tasks backed by Threads instead of Fibers
* ActorProxy is now a BasicObject
* A bug prevented Celluloid subclasses from retaining custom mailboxes
defined by use_mailbox. This is now fixed.
* `exclusive` class method without arguments makes the whole actor exclusive

0.11.1
------
* 'exclusive' class method marks methods as always exclusive and runs them
outside of a Fiber (useful if you need more stack than Fibers provide)
* Celluloid::PoolManager returns its own class when #class is called, instead
of proxying to a cell/actor in the pool.
* #receive now handles SystemEvents internally
* Celluloid::Timers extracted into the timers gem, which Celluloid now
uses for its own timers

0.11.0
------
* Celluloid::Application constant permanently removed
* Celluloid::Pool removed in favor of Celluloid.pool
* Celluloid::Group renamed to Celluloid::SupervisionGroup, old name is
still available and has not been deprecated
* Celluloid::ThreadPool renamed to Celluloid::InternalPool to emphasize its
internalness
* Support for asynchronously calling private methods inside actors
* Future is now an instance method on all actors
* Async call exception logs now contain the failed method
* MyActor#async makes async calls for those who dislike the predicate syntax
* abort can now accept a string instead of an exception object and will raise
RuntimeError in the caller's context

0.10.0
------
* Celluloid::Actor.current is now the de facto way to obtain the current actor
* #terminate now uses system messages, making termination take priority over
other pending methods
* #terminate! provides asynchronous termination

0.9.1
-----
* Recurring timers with Celluloid#every(n) { ... }
* Obtain UUIDs with Celluloid.uuid
* Obtain the number of CPU cores available with Celluloid.cores
* Celluloid::Pool defaults to one actor per CPU core max by default

0.9.0
-----
* Celluloid::Pool supervises pools of actors
Expand Down
9 changes: 7 additions & 2 deletions Gemfile
@@ -1,5 +1,10 @@
source :rubygems
gemspec

gem 'ffi', :platform => :mri
if RUBY_PLATFORM =~ /darwin/
gem 'rb-fsevent', '~> 0.9.1'
end

gemspec
group :custom do
gem 'guard-rspec'
end
5 changes: 5 additions & 0 deletions Guardfile
@@ -0,0 +1,5 @@
guard 'rspec', :version => 2, :cli => '--format documentation' do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec/" }
end
66 changes: 52 additions & 14 deletions README.md
@@ -1,4 +1,4 @@
![Celluloid](https://github.com/celluloid/celluloid/raw/master/logo.png)
![Celluloid](https://raw.github.com/celluloid/celluloid-logos/master/celluloid/celluloid.png)
=========
[![Build Status](https://secure.travis-ci.org/celluloid/celluloid.png?branch=master)](http://travis-ci.org/celluloid/celluloid)
[![Dependency Status](https://gemnasium.com/celluloid/celluloid.png)](https://gemnasium.com/celluloid/celluloid)
Expand All @@ -17,7 +17,7 @@ Much of the difficulty with building concurrent programs in Ruby arises because
the object-oriented mechanisms for structuring code, such as classes and
inheritance, are separate from the concurrency mechanisms, such as threads and
locks. Celluloid combines these into a single structure, an active object
running within a thread, called an "actor".
running within a thread, called an "actor", or in Celluloid vernacular, a "cell".

By combining concurrency with object oriented programming, Celluloid frees you
up from worry about where to use threads and locks. Celluloid combines them
Expand Down Expand Up @@ -50,7 +50,7 @@ features which make concurrent programming simple, easy, and fun:
a clean state. Celluloid provides its own implementation of the core
fault-tolerance concepts in Erlang including [linking](https://github.com/celluloid/celluloid/wiki/Linking),
[supervisors](https://github.com/celluloid/celluloid/wiki/Supervisors),
and [supervision trees](https://github.com/celluloid/celluloid/wiki/Groups).
and [supervision groups](https://github.com/celluloid/celluloid/wiki/Supervision-Groups).

* __[Futures](https://github.com/celluloid/celluloid/wiki/futures):__
Ever wanted to call a method "in the background" and retrieve the
Expand All @@ -63,27 +63,65 @@ features which make concurrent programming simple, easy, and fun:

You can also build distributed systems with Celluloid using its
[sister project DCell](https://github.com/celluloid/dcell). Evented IO similar
to EventMachine (with a synchronous API) is available through the
[Celluloid::IO](https://github.com/celluloid/celluloid-io) library.
to EventMachine (with a synchronous API instead of callback/deferrable soup)
is available through the [Celluloid::IO](https://github.com/celluloid/celluloid-io)
library.

Like Celluloid? [Join the Google Group](http://groups.google.com/group/celluloid-ruby)
or visit us on IRC at #celluloid on freenode

### Is It "Production Ready™"?

Yes, many users are now running Celluloid in production by using
[Sidekiq](http://sidekiq.org) and [Adhearsion](http://adhearsion.com/)

Documentation
-------------

[Please see the Celluloid Wiki](https://github.com/celluloid/celluloid/wiki)
for more detailed documentation and usage notes.

Like Celluloid? [Join the Google Group](http://groups.google.com/group/celluloid-ruby)
or visit us on IRC at #celluloid on freenode
The following API documentation is also available:

* [YARD API documentation](http://rubydoc.info/gems/celluloid/frames)
* [Celluloid module (primary API)](http://rubydoc.info/gems/celluloid/Celluloid)
* [Celluloid class methods](http://rubydoc.info/gems/celluloid/Celluloid/ClassMethods)
* [All Celluloid classes](http://rubydoc.info/gems/celluloid/index)

Installation
------------

Add this line to your application's Gemfile:

gem 'celluloid'

And then execute:

$ bundle

Or install it yourself as:

$ gem install celluloid

Inside of your Ruby program do:

require 'celluloid'

...to pull it in as a dependency.

Supported Platforms
-------------------

Celluloid works on Ruby 1.9.2+, JRuby 1.6 (in 1.9 mode), and Rubinius 2.0. JRuby
or Rubinius are the preferred platforms as they support true hardware-level
parallelism when running Ruby code, whereas MRI/YARV is constrained by a global
interpreter lock (GIL).
Celluloid works on Ruby 1.9.3, JRuby 1.6, and Rubinius 2.0. JRuby or Rubinius
are the preferred platforms as they support true thread-level parallelism when
executing Ruby code, whereas MRI/YARV is constrained by a global interpreter
lock (GIL) and can only execute one thread at a time.

To use JRuby in 1.9 mode, you'll need to pass the "--1.9" command line option
to the JRuby executable, or set the "JRUBY_OPTS=--1.9" environment variable.
Celluloid requires Ruby 1.9 mode on all interpreters. This works out of the
box on MRI/YARV, and requires the following flags elsewhere:

Celluloid works on Rubinius in either 1.8 or 1.9 mode.
* JRuby: --1.9 command line option, or JRUBY_OPTS=--1.9 environment variable
* rbx: -X19 command line option

Additional Reading
------------------
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
@@ -1,4 +1,5 @@
require "bundler/gem_tasks"
Dir["tasks/**/*.task"].each { |task| load task }

task :default => %w(spec benchmark)
task :default => :spec
task :ci => %w(spec benchmark)
4 changes: 2 additions & 2 deletions benchmarks/actor.rb
Expand Up @@ -26,10 +26,10 @@ def example_method; end
ips.report("spawn") { ExampleActor.new.terminate }
ips.report("calls") { example_actor.example_method }
ips.report("async calls") { example_actor.example_method! }

ips.report("messages") do |n|
latch_in << n
for i in 0..n; mailbox << :message; end
latch_out.pop
end
end
end
15 changes: 15 additions & 0 deletions benchmarks/parallel_hash.rb
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'
require 'celluloid'
require 'benchmark/ips'
require File.expand_path("../../examples/pool", __FILE__)

pool = Rehasher.new

Benchmark.ips do |ips|
ips.report("parallel hash") do
64.times.map { pool.future(:rehash, 'w3rd', 10_000) }.map(&:value)
end
end
10 changes: 10 additions & 0 deletions benchmarks/uuid.rb
@@ -0,0 +1,10 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'
require 'celluloid'
require 'benchmark/ips'

Benchmark.ips do |ips|
ips.report("uuid") { Celluloid.uuid }
end
8 changes: 6 additions & 2 deletions celluloid.gemspec
Expand Up @@ -13,12 +13,16 @@ Gem::Specification.new do |gem|
gem.authors = ['Tony Arcieri']
gem.email = ['tony.arcieri@gmail.com']
gem.homepage = 'https://github.com/celluloid/celluloid'


gem.required_ruby_version = '>= 1.9.2'
gem.required_rubygems_version = '>= 1.3.6'

gem.files = Dir['README.md', 'lib/**/*', 'spec/support/**/*']
gem.require_path = 'lib'

gem.add_runtime_dependency 'timers', '>= 1.0.0'
gem.add_runtime_dependency 'facter', '>= 1.6.12'

gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'benchmark_suite'
Expand Down
6 changes: 3 additions & 3 deletions examples/basic_usage.rb
Expand Up @@ -30,12 +30,12 @@ def increment(n = 1)
# This increments @count by 1 and prints 1
p actor.increment

# Adding ! to the end of any method makes the call asynchronous. This means a
# request to execute the method will be sent to an actor, and we have no idea
# By using actor.async, you can make calls asynchronously. This immediately
# requests execution of method by sending a message, and we have no idea
# whether or not that request will actually complete because we don't wait
# for a response. Async calls immediately return nil regardless of how long
# the method takes to execute. Therefore, this will print nil.
p actor.increment! 41
p actor.async.increment 41

# In practice, the asynchronous call made above will increment the count before
# we get here. However, do not rely on this behavior! Asynchronous methods are
Expand Down
12 changes: 6 additions & 6 deletions examples/cigarette_smokers.rb
Expand Up @@ -91,8 +91,8 @@ def inspect
def sit(table)
puts "#{name} sits down at table"

# DON'T USE SELF ACROSS ACTORS!
table.smokers << current_actor
# Always use Actor.current instead of self when talking to other actors
table.smokers << Actor.current
@table = table

@machine.transition :procuring
Expand All @@ -116,7 +116,7 @@ def notify_ready
def check_table
if @table.empty?
puts "#{name} whistles at waitress... get me smokes!"
@table.waitress.whistle! # We'll decide what to do when the waitress arrives
@table.waitress.async.whistle # We'll decide what to do when the waitress arrives
end
end

Expand All @@ -137,7 +137,7 @@ def take_items
items = @table.take

puts "#{name} whistles for the waitress because the table is empty"
@table.waitress.whistle!
@table.waitress.async.whistle

tobacco = find_item items, Tobacco
paper = find_item items, Paper
Expand Down Expand Up @@ -214,7 +214,7 @@ def refill_table
end

puts "Waitress tells #{receiver.name} he can smoke now"
receiver.notify_ready!
receiver.async.notify_ready
note_smokers
end

Expand All @@ -234,7 +234,7 @@ class Table

def initialize
@smokers = []
@waitress = Waitress.new(current_actor) # DON'T USE SELF!
@waitress = Waitress.new(Actor.current) # Always use Actor.current instead of self!
@items = nil
end

Expand Down
2 changes: 1 addition & 1 deletion examples/futures.rb
Expand Up @@ -27,7 +27,7 @@ def add(data, n = 100000)

# Ask the hasher to perform a complex computation. However, since we're using
# a future, this doesn't block the current thread
future = hasher.future(:add, "some data to be hashed")
future = hasher.future.add("some data to be hashed")

# We've kicked off the hasher, but this thread can continue performing other
# activities while the hasher runs in the background
Expand Down