JezK
Edit File: cdesc-SingleThreadExecutor.ri
U:RDoc::NormalClass[iI"SingleThreadExecutor:EFI"%Concurrent::SingleThreadExecutor;FI"'SingleThreadExecutorImplementation;To:RDoc::Markup::Document:@parts[o;;[ o:RDoc::Markup::Paragraph;[I",@!macro [attach] single_thread_executor;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim;[I"NA thread pool with a single thread an unlimited queue. Should the thread ;TI"Ldie for any reason it will be removed and replaced, thus ensuring that ;TI"Kthe executor will always remain viable and available to process jobs. ;TI" ;TI"MA common pattern for background processing is to create a single thread ;TI"Lon which an infinite loop is run. The thread's loop blocks on an input ;TI"Msource (perhaps blocking I/O or a queue) and processes each input as it ;TI"Ois received. This pattern has several issues. The thread itself is highly ;TI"Nsusceptible to errors during processing. Also, the thread itself must be ;TI"Nconstantly monitored and restarted should it die. `SingleThreadExecutor` ;TI"Nencapsulates all these bahaviors. The task processor is highly resilient ;TI"Fto errors from within tasks. Also, should the thread die it will ;TI"!automatically be restarted. ;TI" ;TI"TThe API and behavior of this class are based on Java's `SingleThreadExecutor`. ;T:@format0o; ;[I"1@!macro abstract_executor_service_public_api;T: @fileI"6lib/concurrent/executor/single_thread_executor.rb;T:0@omit_headings_from_table_of_contents_below0; 0;0[ [ [ [[I" class;T[[:public[ [:protected[ [:private[ [I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0;0[@&I"Concurrent;FcRDoc::NormalModule