Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > rinda/tuplespaceライブラリ > Rinda::TupleSpaceクラス

class Rinda::TupleSpace

クラスの継承リスト: Rinda::TupleSpace < MonitorMixin < DRb::DRbUndumped < Object < Kernel < BasicObject

要約

Tuple Space のためのクラスです。 普通は Rinda::TupleSpaceProxy を介して使います。

特異メソッド

new(period = 60)

[TODO]

Rinda::TupleSpace オブジェクトを生成します。

インスタンスメソッド

move(port, tuple, sec = nil)

[TODO]

Moves +tuple+ to +port+.

notify(event, tuple, sec = nil)

[TODO]

Registers for notifications of +event+. Returns a NotifyTemplateEntry. See NotifyTemplateEntry for examples of how to listen for notifications.

+event+ can be:

'write': A tuple was added

'take': A tuple was taken or moved

'delete': A tuple was lost after being overwritten or expiring

The TupleSpace will also notify you of the 'close' event when the NotifyTemplateEntry has expired.

read(tuple, sec=nil)

[TODO]

Reads +tuple+, but does not remove it.

read_all(tuple)

[TODO]

Returns all tuples matching +tuple+. Does not remove the found tuples.

take(tuple, sec = nil)
take(tuple, sec = nil) {|template| ... }

[TODO]

tuple にマッチするタプルをタプルスペースから取り出して返します。 マッチするタプルが存在しない場合は、マッチするタプルがタプルスペースに 投入されるまで待ちます。

待ち時間が sec 秒を過ぎた時には take をあきらめ 例外 Rinda::RequestExpiredError を投げます。

write(tuple, sec = nil)

[TODO]

Rinda::Tuple オブジェクト tuple をタプルスペースに加えます。 tuple を管理するための Rinda::TupleEntry オブジェクトを返します。

class Rinda::TupleSpace