diff options
author | seki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-29 16:21:31 +0000 |
---|---|---|
committer | seki <seki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-29 16:21:31 +0000 |
commit | 858e38c90202dbbf07eb9ffd4b59cf058368f29c (patch) | |
tree | f94839d30b5edd7963aae2c3ea3d988ce16daf85 | |
parent | dda452747887037dc5f1969b3f23403bb592c084 (diff) | |
download | ruby-858e38c90202dbbf07eb9ffd4b59cf058368f29c.tar.gz |
* lib/rinda/tuplespace.rb (TupleSpace#create_entry, TupleBag#push,
delete): extract method, and rename parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/rinda/tuplespace.rb | 22 |
2 files changed, 18 insertions, 9 deletions
@@ -1,3 +1,8 @@ +Mon Apr 30 01:17:51 2007 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> + + * lib/rinda/tuplespace.rb (TupleSpace#create_entry, TupleBag#push, + delete): extract method, and rename parameter. + Fri Apr 27 02:00:17 2007 Ryan Davis <ryand-ruby@zenspider.com> * signal.c: Fixed backwards compatibility for 'raise Interrupt'. diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb index 73e79bb401..cb86b47221 100644 --- a/lib/rinda/tuplespace.rb +++ b/lib/rinda/tuplespace.rb @@ -304,20 +304,20 @@ module Rinda end ## - # Add +ary+ to the TupleBag. + # Add +tuple+ to the TupleBag. - def push(ary) - size = ary.size + def push(tuple) + size = tuple.size @hash[size] ||= [] - @hash[size].push(ary) + @hash[size].push(tuple) end ## - # Removes +ary+ from the TupleBag. + # Removes +tuple+ from the TupleBag. - def delete(ary) - size = ary.size - @hash.fetch(size, []).delete(ary) + def delete(tuple) + size = tuple.size + @hash.fetch(size, []).delete(tuple) end ## @@ -403,7 +403,7 @@ module Rinda # Adds +tuple+ def write(tuple, sec=nil) - entry = TupleEntry.new(tuple, sec) + entry = create_entry(tuple, sec) start_keeper synchronize do if entry.expired? @@ -529,6 +529,10 @@ module Rinda private + def create_entry(tuple, sec) + TupleEntry.new(tuple, sec) + end + ## # Removes dead tuples. |