<?php

declare(strict_types=1);

namespace Drupal\flowdrop_trigger\Enum;

/**
 * Defines the execution modes for triggered workflows.
 *
 * @internal This enum is not part of the public API and may change without notice.
 */
enum TriggerExecutionMode: string {

  // Synchronous execution - blocks until complete.
  case Sync = 'sync';

  // Asynchronous execution - returns immediately.
  case Async = 'async';

  /**
   * Gets a human-readable label for the execution mode.
   *
   * @return string
   *   The label.
   */
  public function label(): string {
    return match ($this) {
      self::Sync => 'Synchronous',
      self::Async => 'Asynchronous',
    };
  }

}
