Skip to content

Commit

Permalink
Catch and Throw are Event subclasses now.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Feb 14, 2024
1 parent 4739a7b commit 6eb72ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/trailblazer/workflow/event.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module Trailblazer
module Workflow
module Event
class Suspend < Activity::End
class Event < Activity::End
class Suspend < Event
end

class Throw < Activity::End
class Throw < Event
def call((ctx, flow_options), **circuit_options)
flow_options = flow_options.merge(
throw: flow_options[:throw] + [[self, "message"]] # DISCUSS: what message do we want to pass on?
Expand All @@ -14,7 +14,7 @@ def call((ctx, flow_options), **circuit_options)
end
end # Throwing

class Catch < Activity::End
class Catch < Event
def call((ctx, flow_options), **circuit_options)
return Activity::Right, [ctx, flow_options]
end
Expand Down

0 comments on commit 6eb72ec

Please sign in to comment.