JezK
Edit File: send-i.ri
U:RDoc::AnyMethod[iI" send:EFI"Concurrent::Agent#send;FF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I" @!macro [attach] agent_send;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"NDispatches an action to the Agent and returns immediately. Subsequently, ;TI"Lin a thread from a thread pool, the {#value} will be set to the return ;TI"Lvalue of the action. Action dispatches are only allowed when the Agent ;TI"is not {#failed?}. ;TI" ;TI"MThe action must be a block/proc/lambda which takes 1 or more arguments. ;TI"LThe first argument is the current {#value} of the Agent. Any arguments ;TI"Npassed to the send method via the `args` parameter will be passed to the ;TI"Maction as the remaining arguments. The action must return the new value ;TI"of the Agent. ;TI" ;TI"L* {#send} and {#send!} should be used for actions that are CPU limited ;TI"M* {#send_off}, {#send_off!}, and {#<<} are appropriate for actions that ;TI" may block on IO ;TI"L* {#send_via} and {#send_via!} are used when a specific executor is to ;TI" be used for the action ;TI" ;TI"H@param [Array<Object>] args zero or more arguments to be passed to ;TI" the action ;TI"=@param [Proc] action the action dispatch to be enqueued ;TI" ;TI"K@yield [agent, value, *args] process the old value and return the new ;TI"B@yieldparam [Object] value the current {#value} of the Agent ;TI"L@yieldparam [Array<Object>] args zero or more arguments to pass to the ;TI" action ;TI"6@yieldreturn [Object] the new value of the Agent ;T:@format0o; ; [I"!@!macro [attach] send_return;To;; [I"M@return [Boolean] true if the action is successfully enqueued, false if ;TI" the Agent is {#failed?};T; 0: @fileI"lib/concurrent/agent.rb;T:0@omit_headings_from_table_of_contents_below000[ I"(*args, &action);T@2FI" Agent;FcRDoc::NormalClass00