Skip to content

Instantly share code, notes, and snippets.

@danwrong
Created June 4, 2009 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danwrong/123613 to your computer and use it in GitHub Desktop.
Save danwrong/123613 to your computer and use it in GitHub Desktop.
state :new, :default => true do
handle :queue! do
enqueue
transition_to :queued
save!
end
handle :fetch_ga_data! do
fetch_ga_data
extract_terms
transition_to :fetched_ga_data
save!
end
transition :to => :queued
transition :to => :fetched_ga_data
transition :to => :error, :on => :error!
end
state :queued do
handle :start! do
transition_to :started
save!
end
transition :to => :started
end
state :started do
handle :fetch_ga_data! do
fetch_ga_data
extract_terms
transition_to :fetched_ga_data
save!
end
transition :to => :fetched_ga_data
transition :to => :error, :on => :error!
end
state :fetched_ga_data do
handle :compile_niches! do
compile_niche_data
transition_to :compiled_niches
save!
end
transition :to => :compiled_niches
transition :to => :error, :on => :error!
end
state :compiled_niches do
handle :fetch_gtool_data! do
fetch_gtool_data
transition_to :complete
save!
end
transition :to => :complete
transition :to => :error, :on => :error!
end
state :complete
state :error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment