Skyvern/skyvern/forge/sdk/executor/factory.py
2024-03-01 10:09:30 -08:00

13 lines
411 B
Python

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