omnipy.shared.protocols.hub.registry
Protocols for tracking job run-state transitions.
| CLASS | DESCRIPTION |
|---|---|
IsRunStateRegistry |
Protocol for registries that track job run states. |
IsRunStateRegistry
Bases: Protocol
flowchart BT
omnipy.shared.protocols.hub.registry.IsRunStateRegistry[IsRunStateRegistry]
click omnipy.shared.protocols.hub.registry.IsRunStateRegistry href "" "omnipy.shared.protocols.hub.registry.IsRunStateRegistry"
Protocol for registries that track job run states.
| METHOD | DESCRIPTION |
|---|---|
__init__ |
|
all_jobs |
Return all registered jobs, optionally filtered by their current state. |
get_job_state |
Return the current run state registered for a job. |
get_job_state_datetime |
Return when the job was recorded in a specific run state. |
set_job_state |
Register a job transition, update indexes, and emit the matching log event. |
Source code in src/omnipy/shared/protocols/hub/registry.py
__init__
all_jobs
all_jobs(state: RunState.Literals | None = None) -> tuple[IsUniquelyNamedJob, ...]
Return all registered jobs, optionally filtered by their current state.
| PARAMETER | DESCRIPTION |
|---|---|
state
|
Optional run-state filter limiting the returned jobs. |
| RETURNS | DESCRIPTION |
|---|---|
tuple[IsUniquelyNamedJob, ...]
|
tuple[IsUniquelyNamedJob, ...]: Registered jobs matching the requested filter. |
Source code in src/omnipy/shared/protocols/hub/registry.py
get_job_state
get_job_state(job: IsUniquelyNamedJob) -> RunState.Literals
Return the current run state registered for a job.
| PARAMETER | DESCRIPTION |
|---|---|
job
|
Job whose current run state should be looked up.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
RunState.Literals
|
RunState.Literals: Current run-state literal for the job. |
Source code in src/omnipy/shared/protocols/hub/registry.py
get_job_state_datetime
get_job_state_datetime(job: IsUniquelyNamedJob, state: RunState.Literals) -> datetime
Return when the job was recorded in a specific run state.
| PARAMETER | DESCRIPTION |
|---|---|
job
|
Job whose transition time should be looked up.
TYPE:
|
state
|
Run-state literal to query. |
| RETURNS | DESCRIPTION |
|---|---|
datetime
|
Timestamp recorded for the requested transition.
TYPE:
|
Source code in src/omnipy/shared/protocols/hub/registry.py
set_job_state
set_job_state(job: IsUniquelyNamedJob, state: RunState.Literals) -> None
Register a job transition, update indexes, and emit the matching log event.
| PARAMETER | DESCRIPTION |
|---|---|
job
|
Job whose state transition should be recorded.
TYPE:
|
state
|
New run-state literal to register. |