Sha256: cbc24d724613818e417aa8eb8611e5ce14e0fbb15fa918c96bf44e2dc41a9ec6

Contents?: true

Size: 902 Bytes

Versions: 2

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

module Dynflow
  class Action::Suspended
    attr_reader :execution_plan_id, :step_id

    def initialize(action)
      @world             = action.world
      @execution_plan_id = action.execution_plan_id
      @step_id           = action.run_step_id
    end

    def plan_event(event, time, sent = Concurrent::Promises.resolvable_future, optional: false)
      @world.plan_event(execution_plan_id, step_id, event, time, sent, optional: optional)
    end

    def event(event, sent = Concurrent::Promises.resolvable_future, optional: false)
      # TODO: deprecate 2 levels backtrace (to know it's called from clock or internaly)
      # remove lib/dynflow/clock.rb ClockReference#ping branch condition on removal.
      plan_event(event, nil, sent, optional: optional)
    end

    def <<(event = nil)
      event event
    end

    alias_method :ask, :event
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dynflow-1.9.0 lib/dynflow/action/suspended.rb
dynflow-1.8.3 lib/dynflow/action/suspended.rb