<?php

declare(strict_types=1);

namespace Drupal\flowdrop_workflow_executor\Enum;

/**
 * Defines the execution modes for workflow execution.
 *
 * @api
 */
enum WorkflowExecutionMode: string {

  // Create job and wait for completion.
  case Job = 'job';

  // Create job and return immediately (async).
  case JobAsync = 'job_async';

  // Fire and forget, no result tracking.
  case JobFireForget = 'job_fire_forget';

  /**
   * Gets a human-readable label for the execution mode.
   *
   * @return string
   *   The label.
   */
  public function label(): string {
    return match ($this) {
      self::Job => 'Job (wait for completion)',
      self::JobAsync => 'Async (return session ID)',
      self::JobFireForget => 'Fire & Forget',
    };
  }

}
