Conditionally Introduced Tasks Managed in State Machines (CITMISM)

In an effort to ensure code is responsible for its own needs, I am thinking of moving away from a queue-based background processing solution to one that pulls work based on conditions. So you don’t need to schedule a task, but a task just happens if certain conditions are met.

For example: Condition: Fileclass==IMG AND (Thumb500StateMachine = null OR state != DONE) Action(s):

  1. Assign State machine with initial state NEW.
  2. Commence generating thumbnail. Then update state. State machine [NEW]->[IN PROGRESS]->[DONE]

An important consideration is that the state machine should, where appropriate, use Operations that can also be called individually. E.g. to update a thumbnail as a result of an edit operation.