Displaying 1 result from an estimated 1 matches for "find_all_pending".
2007 Nov 21
2
Is fork { } safe inside of a worker? How else may this be done...
I have a BackgrounDRb worker running every 2 minutes. Here''s the basic idea:
- events = Event.find_all_pending( 2.minutes )
- while( all events have yet to be processed )
---- if( Time.now <= event.time_to_process )
------- fork { process_event }
--- end
--- sleep( 0.25 )
- end
- puts "Done..."
Events that need to be processed within the next 2 minutes are loaded and
iterated over. If its time...