別のキーワード
ライブラリ
- ビルトイン (112)
-
rinda
/ rinda (11) -
rinda
/ tuplespace (22)
クラス
-
Enumerator
:: Lazy (101) -
Rinda
:: TupleSpace (22) -
Rinda
:: TupleSpaceProxy (11)
モジュール
- Enumerable (11)
キーワード
- drop (11)
-
drop
_ while (11) -
filter
_ map (5) - grep (11)
-
grep
_ v (9) - lazy (11)
- map (11)
- notify (11)
-
slice
_ after (10) -
slice
_ before (11) - zip (22)
検索結果
先頭5件
-
Rinda
:: TupleSpaceProxy # take(tuple , sec = nil) -> Array | Hash (21226.0) -
tuple にマッチするタプルをタプルスペースから取り出して返します。
...tuple にマッチするタプルをタプルスペースから取り出して返します。
内部的にはリモートオブジェクトの Rinda::TupleSpace#take にフォワードされます。
詳細は Rinda::TupleSpace#take を参照してください。
@param tuple タプルのパター......ン
@param sec タイムアウト秒数
@raise Rinda::RequestExpiredError take がタイムアウトした場合に発生します
@raise Ridna::RequestCanceledError take が何らかの理由でキャンセルされた場合に発生します。... -
Rinda
:: TupleSpace # take(tuple , sec = nil) -> Array | Hash (21220.0) -
tuple にマッチするタプルをタプルスペースから取り出して返します。
...tuple にマッチするタプルをタプルスペースから取り出して返します。
tuple で指定できるパターンについては lib:rinda/rinda#tuplepattern を
参照してください。
マッチするタプルが存在しない場合は、マッチするタプルがタプル......時には take をあきらめ
例外 Rinda::RequestExpiredError を発生させます。
sec に nil を指定するとタイムアウトせずに無限に待ち続けます。
@param tuple タプルのパターン
@param sec タイムアウト秒数
@raise Rinda::RequestExpiredError take がタ......イムアウトした場合に発生します
@raise Ridna::RequestCanceledError take が何らかの理由でキャンセルされた場合に発生します。... -
Enumerator
:: Lazy # drop(n) -> Enumerator :: Lazy (6107.0) -
Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#drop と同じですが、配列ではなくEnumerator::Lazy を返します。
@param n 要素数を指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。
//emlist[例][ruby]{
1.step.lazy.drop(3)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #......<Enumerator: 1:step>>:drop(3)>
1.step.lazy.drop(3).take(10).force
# => [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
//}
@see Enumerable#drop... -
Enumerator
:: Lazy # drop _ while {|item| . . . } -> Enumerator :: Lazy (6107.0) -
Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>
1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42......, 43, 44, 45, 46, 47, 48, 49, 50, 51]
//}
@see Enumerable#drop_while... -
Enumerator
:: Lazy # filter _ map {|item| . . . } -> Enumerator :: Lazy (6107.0) -
Enumerable#filter_map と同じですが、配列ではなく Enumerator::Lazy を返します。
...ap と同じですが、配列ではなく Enumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.filter_map { |n| n * 2 if n.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: (1.step)>:filter_map......>
1.step.lazy.filter_map { |n| n * 2 if n.even? }.take(10).force
# => [4, 8, 12, 16, 20, 24, 28, 32, 36, 40]
//}
@see Enumerable#filter_map... -
Enumerator
:: Lazy # grep(pattern) {|item| . . . } -> Enumerator :: Lazy (6107.0) -
Enumerable#grep と同じですが、配列ではなくEnumerator::Lazy を返します。
...rep と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).lazy.map(&......:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep......:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}
@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v... -
Enumerator
:: Lazy # grep _ v(pattern) {|item| . . . } -> Enumerator :: Lazy (6107.0) -
Enumerable#grep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
...rep_v と同じですが、配列ではなくEnumerator::Lazy を返します。
//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).lazy.map(&......:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}
@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep... -
Enumerator
:: Lazy # zip(*lists) -> Enumerator :: Lazy (6107.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #......<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}
@see Enumerable#zip... -
Enumerator
:: Lazy # zip(*lists) {|v1 , v2 , . . . | . . . } -> nil (6107.0) -
Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
...Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。
ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。
//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #......<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>
1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}
@see Enumerable#zip... -
Rinda
:: TupleSpace # notify(event , pattern , sec = nil) -> Rinda :: NotifyTemplateEntry (3119.0) -
event で指定した種類のイベントの監視を開始します。
...ます。
イベントを生じさせたタプルがpattern にマッチした場合にのみ報告されます。
イベントが生じた場合、
このメソッドの返り値の Rinda::NotifyTemplateEntry を経由し、
Rinda::NotifyTemplateEntry#each を用いて報告を受け取ります......で無限に監視し続けます。
event として以下の3つを指定できます。
* 'write' : タプルが追加された
* 'take' : タプルが take された
* 'delete' : タプルが有効期限切れや上書きされたなどでタプルスペースから削除された
これ......ベントが報告されます。
pattern で指定できるパターンについては lib:rinda/rinda#tuplepattern を
参照してください。
@param event 監視対象のイベント(文字列)
@param pattern 監視対象となるタプルのパターン
@param sec 監視期間の長さ(秒...