🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-08 09:31:12 | PHP 8.2.32
📂
/ (Root)
/
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
reactivex
/
scheduler
📍 /opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler
🔄 Refresh
✏️
Editing: threadpoolscheduler.py
Read Only
from concurrent.futures import Future, ThreadPoolExecutor from typing import Any, Optional from reactivex import abc, typing from .newthreadscheduler import NewThreadScheduler class ThreadPoolScheduler(NewThreadScheduler): """A scheduler that schedules work via the thread pool.""" class ThreadPoolThread(abc.StartableBase): """Wraps a concurrent future as a thread.""" def __init__( self, executor: ThreadPoolExecutor, target: typing.StartableTarget ): self.executor: ThreadPoolExecutor = executor self.target: typing.StartableTarget = target self.future: Optional["Future[Any]"] = None def start(self) -> None: self.future = self.executor.submit(self.target) def cancel(self) -> None: if self.future: self.future.cancel() def __init__(self, max_workers: Optional[int] = None) -> None: self.executor: ThreadPoolExecutor = ThreadPoolExecutor(max_workers=max_workers) def thread_factory( target: typing.StartableTarget, ) -> ThreadPoolScheduler.ThreadPoolThread: return self.ThreadPoolThread(self.executor, target) super().__init__(thread_factory)
💾 Save Changes
❌ Cancel