Skip to content

Conversation

@Mangara
Copy link
Contributor

@Mangara Mangara commented Sep 8, 2021

A first stab at addressing #103

This would add a hook to let jobs define their own interruption behaviour:

class JobThatInterrupts < ActiveJob::Base
    include JobIteration::Iteration

    stop_iterating_on(->(job) { !Database.healthy? })
    stop_iterating_on(->(job) { MyThrottle.throttle? })

    ...
  end

@Mangara Mangara self-assigned this Sep 8, 2021
@Mangara Mangara force-pushed the add-interruption-hook branch from 6941cc5 to 3555d57 Compare September 24, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant