ccproxy.scheduler.registry¶
ccproxy.scheduler.registry
¶
Task registry for dynamic task registration and discovery.
TaskRegistry
¶
Registry for managing scheduled task registration and discovery.
Provides a centralized way to register and retrieve scheduled tasks, enabling dynamic task management and configuration.
Source code in ccproxy/scheduler/registry.py
register
¶
Register a scheduled task class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Unique name for the task |
required |
task_class
|
type[BaseScheduledTask]
|
Task class that inherits from BaseScheduledTask |
required |
Raises:
Type | Description |
---|---|
TaskRegistrationError
|
If task name is already registered or invalid |
Source code in ccproxy/scheduler/registry.py
unregister
¶
Unregister a scheduled task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the task to unregister |
required |
Raises:
Type | Description |
---|---|
TaskRegistrationError
|
If task is not registered |
Source code in ccproxy/scheduler/registry.py
get
¶
Get a registered task class by name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the task to retrieve |
required |
Returns:
Type | Description |
---|---|
type[BaseScheduledTask]
|
Task class |
Raises:
Type | Description |
---|---|
TaskRegistrationError
|
If task is not registered |
Source code in ccproxy/scheduler/registry.py
list_tasks
¶
is_registered
¶
clear
¶
get_registry_info
¶
Get information about the current registry state.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
Dictionary with registry information |
Source code in ccproxy/scheduler/registry.py
get_task_registry
¶
Get the global task registry instance.
Returns:
Type | Description |
---|---|
TaskRegistry
|
Global TaskRegistry instance |
Source code in ccproxy/scheduler/registry.py
register_task
¶
Register a task in the global registry.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Unique name for the task |
required |
task_class
|
type[BaseScheduledTask]
|
Task class that inherits from BaseScheduledTask |
required |