JezK
Edit File: cdesc-Delay.ri
U:RDoc::NormalClass[iI" Delay:EFI"Concurrent::Delay;FI"$Synchronization::LockableObject;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[ I"ILazy evaluation of a block yielding an immutable result. Useful for ;TI"Lexpensive operations that may never be needed. It may be non-blocking, ;TI"Psupports the `Concern::Obligation` interface, and accepts the injection of ;TI"Dcustom executor upon which to execute the block. Processing of ;TI"Eblock will be deferred until the first time `#value` is called. ;TI"FAt that time the caller can choose to return immediately and let ;TI"Dthe block execute asynchronously, block indefinitely, or block ;TI"with a timeout.;To:RDoc::Markup::BlankLine o; ;[I"LWhen a `Delay` is created its state is set to `pending`. The value and ;TI"Mreason are both `nil`. The first time the `#value` method is called the ;TI"Lenclosed opration will be run and the calling thread will block. Other ;TI"Pthreads attempting to call `#value` will block as well. Once the operation ;TI"Ois complete the *value* will be set to the result of the operation or the ;TI"O*reason* will be set to the raised exception, as appropriate. All threads ;TI"Tblocked on `#value` will return. Subsequent calls to `#value` will immediately ;TI"Sreturn the cached value. The operation will only be run once. This means that ;TI"Many side effects created by the operation will only happen once as well.;T@o; ;[I"Y`Delay` includes the `Concurrent::Concern::Dereferenceable` mixin to support thread ;TI"2safety of the reference returned by `#value`.;T@o; ;[I"@!macro copy_options;T@o; ;[I"3@!macro [attach] delay_note_regarding_blocking;To:RDoc::Markup::Verbatim;[I"I@note The default behavior of `Delay` is to block indefinitely when ;TI"L calling either `value` or `wait`, executing the delayed operation on ;TI"E the current thread. This makes the `timeout` value completely ;TI"G irrelevant. To enable non-blocking behavior, use the `executor` ;TI"G constructor option. This will cause the delayed operation to be ;TI"D execute on the given executor, allowing the call to timeout. ;T:@format0o; ;[I".@see Concurrent::Concern::Dereferenceable;T: @fileI"lib/concurrent/delay.rb;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [[I"Concern::Obligation;To;;[ ; @9;0I"lib/concurrent/delay.rb;T[[I" class;T[[:public[[I"new;T@A[:protected[ [:private[ [I" instance;T[[;[ [I"reconfigure;F@A[I" value;F@A[I"value!;F@A[I" wait;F@A[;[[I"ns_initialize;F@A[;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@9I"Concurrent;FcRDoc::NormalModule