🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-09 07:40:26 | PHP 8.2.33
📂
/ (Root)
/
opt
/
alt
/
python38
/
lib
/
python3.8
/
site-packages
/
reactivex
/
scheduler
/
__pycache__
📍 /opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler/__pycache__
🔄 Refresh
✏️
Editing: scheduler.cpython-38.pyc
Read Only
U v�i � @ s� d dl mZ d dlmZmZmZ d dlmZmZ d dlm Z mZ d dl m Z d dlmZ d dl mZ ed�ZG d d � d e j�ZdS )� )�abstractmethod)�datetime� timedelta�timezone)�Optional�TypeVar)�abc�typing)� Disposable��default_now)�UTC_ZERO�_TStatec @ s� e Zd ZdZeed�dd��Zedej e ee ejd�dd��Z edejej e ee ejd �d d��Zedejej e ee ejd �dd ��Zdej e ee ejd�dd�Zeejed�dd��Zeejed�dd��Zeejed�dd��ZdS )� Schedulerz�Base class for the various scheduler implementations in this package as well as the mainloop sub-package. This does not include an implementation of schedule_periodic, refer to PeriodicScheduler. )�returnc C s t � S )z�Represents a notion of time for this scheduler. Tasks being scheduled on a scheduler will adhere to the time denoted by this property. Returns: The scheduler's current time, as a datetime instance. r )�self� r �N/opt/alt/python38/lib/python3.8/site-packages/reactivex/scheduler/scheduler.py�now s z Scheduler.nowN)�action�stater c C s t S )a! Schedules an action to be executed. Args: action: Action to be executed. state: [Optional] state to be given to the action function. Returns: The disposable object used to cancel the scheduled action (best effort). ��NotImplemented)r r r r r r �schedule s zScheduler.schedule)�duetimer r r c C s t S )au Schedules an action to be executed after duetime. Args: duetime: Relative time after which to execute the action. action: Action to be executed. state: [Optional] state to be given to the action function. Returns: The disposable object used to cancel the scheduled action (best effort). r �r r r r r r r �schedule_relative0 s zScheduler.schedule_relativec C s t S )ao Schedules an action to be executed at duetime. Args: duetime: Absolute time at which to execute the action. action: Action to be executed. state: [Optional] state to be given to the action function. Returns: The disposable object used to cancel the scheduled action (best effort). r r r r r �schedule_absoluteE s zScheduler.schedule_absolutec C s || |�}t |tj�r|S t� S )ap Invoke the given given action. This is typically called by instances of ScheduledItem. Args: action: Action to be executed. state: [Optional] state to be given to the action function. Returns: The disposable object returned by the action, if any; or a new (no-op) disposable otherwise. )� isinstancer �DisposableBaser )r r r �retr r r � invoke_actionZ s zScheduler.invoke_action)�valuer c C s( t |t�r|t }t |t�r$|�� }|S )aQ Converts time value to seconds. This method handles both absolute (datetime) and relative (timedelta) values. If the argument is already a float, it is simply returned unchanged. Args: value: the time value to convert to seconds. Returns: The value converted to seconds. )r r r r � total_seconds��clsr"