<?php

declare(strict_types=1);

namespace App\Framework\Async\Contracts;

use App\Framework\Async\AsyncPromise;

/**
 * Interface for components that can execute operations asynchronously
 */
interface AsyncCapable
{
    /**
     * Execute operation asynchronously
     */
    public function async(): AsyncPromise;

    /**
     * Execute operation synchronously
     */
    public function sync(): mixed;

    /**
     * Check if async execution is available
     */
    public function supportsAsync(): bool;
}
