JezK
Edit File: try_exchange-i.ri
U:RDoc::AnyMethod[iI"try_exchange:EFI"/Concurrent::AbstractExchanger#try_exchange;FF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I")@!macro exchanger_method_do_exchange;To:RDoc::Markup::BlankLine o; ; [I"3@!macro [attach] exchanger_method_try_exchange;T@o:RDoc::Markup::Verbatim; [I"PThe return value will be a {Concurrent::Maybe} set to `Just` on success or ;TI"`Nothing` on timeout. ;TI" ;TI"Q@return [Concurrent::Maybe] on success a `Just` maybe will be returned with ;TI"H the item exchanged by the other thread as `#value`; on timeout a ;TI"U `Nothing` maybe will be returned with {Concurrent::TimeoutError} as `#reason` ;TI" ;TI"@example ;TI" ;TI"- exchanger = Concurrent::Exchanger.new ;TI" ;TI". result = exchanger.exchange(:foo, 0.5) ;TI" ;TI" if result.just? ;TI"$ puts result.value #=> :bar ;TI" else ;TI" puts 'timeout' ;TI" end;T:@format0: @fileI" lib/concurrent/exchanger.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(value, timeout = nil);T@&FI"AbstractExchanger;FcRDoc::NormalClass00