Class: Falqon::Strategies::Linear
- Inherits:
-
Falqon::Strategy
- Object
- Falqon::Strategy
- Falqon::Strategies::Linear
- Defined in:
- lib/falqon/strategies/linear.rb
Overview
Retry strategy that retries a fixed number of times
When a message fails to process, it is moved to the scheduled queue, and retried after a fixed delay (configured by Queue#retry_delay). If a messages fails to process after the maximum number of retries (configured by Queue#max_retries), it is marked as dead, and moved to the dead subqueue.
When using the linear strategy and the retry delay is set to a non-zero value, a scheduled needs to be started to retry the messages after the configured delay.
queue = Falqon::Queue.new("my_queue")
# Start the watcher in a separate thread
Thread.new { loop { queue.schedule; sleep 1 } }
# Or start the watcher in a separate fiber
Fiber
.new { loop { queue.schedule; sleep 1 } }
.resume