shareable_lambda(self: nil) { ... } -> ProcRuby 4.0 から[permalink][rdoc][edit][T] () { (?) [self: nil] → T } → ^(?) [self: nil] → T[T, S] (self: S) { (?) [self: S] → T } → ^(?) [self: S] → T-
Ractor.shareable_proc と同じですが、lambda である Proc を返します。
- [PARAM]
self: -
作成する Proc の
selfにするオブジェクトを指定します。shareable でなければなりません。デフォルトは nil です。 - [EXCEPTION]
Ractor::IsolationError: -
selfが shareable でない場合や、ブロックが shareable でないオブジェクトを参照している場合に発生します。
l = Ractor.shareable_lambda { 42 } p Ractor.shareable?(l) # => true p l.lambda? # => true[SEE_ALSO] Ractor.shareable_proc
- [PARAM]