Skyvern/skyvern/forge/sdk/executor/factory.py
2025-12-11 10:25:12 -07:00

14 lines
474 B
Python

from skyvern.forge.sdk.executor.async_executor import AsyncExecutor
from skyvern.forge.sdk.executor.background_task_executor import BackgroundTaskExecutor
class AsyncExecutorFactory:
__instance: AsyncExecutor = BackgroundTaskExecutor()
@staticmethod
def set_executor(executor: AsyncExecutor) -> None:
AsyncExecutorFactory.__instance = executor
@staticmethod
def get_executor() -> AsyncExecutor:
return AsyncExecutorFactory.__instance