Class: CommandTower::Messaging::ChannelDelivery

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/command_tower/messaging/channel_delivery.rb

Constant Summary collapse

STATUS_PLANNED =
"planned"
STATUS_QUEUED =
"queued"
STATUS_EXECUTING =
"executing"
STATUS_ACCEPTED_BY_PROVIDER =
"accepted_by_provider"
STATUS_FAILED_RETRYABLE =
"failed_retryable"
STATUS_FAILED_TERMINAL =
"failed_terminal"
EXECUTION_TERMINAL_STATUSES =
[
  STATUS_ACCEPTED_BY_PROVIDER,
  STATUS_FAILED_TERMINAL,
].freeze

Instance Method Summary collapse

Methods inherited from ApplicationRecord

attribute_to_type_mapping

Instance Method Details

#execution_claimable?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'app/models/command_tower/messaging/channel_delivery.rb', line 40

def execution_claimable?
  status == STATUS_QUEUED
end

#execution_terminal?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'app/models/command_tower/messaging/channel_delivery.rb', line 36

def execution_terminal?
  EXECUTION_TERMINAL_STATUSES.include?(status)
end