API Reference¶
This page collects the main public Asyncz types in one place.
Schedulers¶
asyncz.schedulers.asyncio.AsyncIOScheduler
¶
Bases: BaseScheduler
A scheduler that runs on an asyncio event loop.
This scheduler is typically to run with asyncio which means that any ASGI framework can also use it internally if needed. For example, Ravyn and Starlette.
| PARAMETER | DESCRIPTION |
|---|---|
event_loop
|
AsyncIO event loop to use. Default to the global event loop.
|
isolated_event_loop
|
Use a fresh, isolated event_loop instead the existing.
|
Source code in asyncz/schedulers/base.py
running
property
¶
Return True if the scheduler has been started. This is a shortcut for scheduler.state != SchedulerState.STATE_STOPPED.
start
¶
Source code in asyncz/schedulers/asyncio.py
shutdown
¶
start_timer
¶
stop_timer
¶
wakeup
¶
create_default_executor
¶
pause
¶
Pause task processing in the scheduler.
This will prevent the scheduler from waking up to do task processing until resume is called. It will not however stop any already running task processing.
Source code in asyncz/schedulers/base.py
resume
¶
Resume task processing in the scheduler.
Source code in asyncz/schedulers/base.py
add_executor
¶
Source code in asyncz/schedulers/base.py
remove_executor
¶
Removes the executor by the given alias from this scheduler.
Source code in asyncz/schedulers/base.py
add_store
¶
Adds a task store to this scheduler.
Any extra keyword arguments will be passed to the task store plugin's constructor, assuming that the first argument is the name of a task store plugin.
Source code in asyncz/schedulers/base.py
remove_store
¶
Removes the task store by the given alias from this scheduler.
Source code in asyncz/schedulers/base.py
add_listener
¶
add_listener(callback, mask=EVENT_ALL)
Adds a listener for scheduler events.
When a matching event occurs, callback is executed with the event object as its sole argument. If the mask parameter is not provided, the callback will receive events of all types.
| PARAMETER | DESCRIPTION |
|---|---|
callback
|
any callable that takes one argument.
TYPE:
|
mask
|
bitmask that indicates which events should be listened to.
TYPE:
|
Source code in asyncz/schedulers/base.py
remove_listener
¶
Removes a previously added event listener.
Source code in asyncz/schedulers/base.py
add_task
¶
add_task(
fn_or_task=None,
trigger=None,
args=None,
kwargs=None,
id=None,
name=None,
mistrigger_grace_time=undefined,
coalesce=undefined,
max_instances=undefined,
next_run_time=undefined,
store=None,
executor=None,
replace_existing=False,
fn=None,
**trigger_args,
)
Adds the given task to the task list and wakes up the scheduler if it's already running.
Any option that defaults to undefined will be replaced with the corresponding default value when the task is scheduled (which happens when the scheduler is started, or immediately if the scheduler is already running).
The fn argument can be given either as a callable object or a textual reference in the package.module:some.object format, where the first half (separated by :) is an importable module and the second half is a reference to the callable object, relative to the module.
The trigger argument can either be
. The alias name of the trigger (e.g. date, interval or cron), in which case any extra keyword arguments to this method are passed on to the trigger's constructor. . An instance of a trigger class (TriggerType).
| PARAMETER | DESCRIPTION |
|---|---|
fn
|
Callable (or a textual reference to one) to run at the given time.
TYPE:
|
trigger
|
Trigger instance that determines when fn is called.
TYPE:
|
args
|
List of positional arguments to call fn with.
TYPE:
|
kwargs
|
Dict of keyword arguments to call fn with.
TYPE:
|
id
|
Explicit identifier for the task (for modifying it later).
TYPE:
|
name
|
Textual description of the task.
TYPE:
|
mistriger_grace_time
|
Seconds after the designated runtime that the task is still allowed to be run (or None to allow the task to run no matter how late it is).
|
coalesce
|
Run once instead of many times if the scheduler determines that the task should be run more than once in succession.
TYPE:
|
max_instances
|
Maximum number of concurrently running instances allowed for this task.
TYPE:
|
next_run_time
|
When to first run the task, regardless of the trigger (pass None to add the task as paused).
TYPE:
|
store
|
Alias of the task store to store the task in.
TYPE:
|
executor
|
Alias of the executor to run the task with.
TYPE:
|
replace_existing
|
True to replace an existing task with the same id (but retain the number of runs from the existing one).
TYPE:
|
Source code in asyncz/schedulers/base.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | |
update_task
¶
Modifies the properties of a single task.
Modifications are passed to this method as extra keyword arguments.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
reschedule_task
¶
Constructs a new trigger for a task and updates its next run time.
Extra keyword arguments are passed directly to the trigger's constructor.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
trigger
|
Alias of the trigger type or a trigger instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
pause_task
¶
Causes the given task not to be executed until it is explicitly resumed.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
resume_task
¶
Resumes the schedule of the given task, or removes the task if its schedule is finished.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
run_task
¶
Submit a task to its configured executor immediately.
This method centralizes the "run now" behavior that operational surfaces such as the CLI and dashboard need. It reuses the task's configured executor, dispatches the same submission-related events that the main scheduler loop emits, and persists the task's updated schedule state.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The task instance or identifier to execute immediately.
TYPE:
|
store
|
Optional preferred store alias when resolving the task.
TYPE:
|
force
|
When
TYPE:
|
remove_finished
|
When
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[TaskType, None]
|
The updated task when it remains scheduled or paused, or |
Union[TaskType, None]
|
it was removed because the schedule finished and |
Union[TaskType, None]
|
was requested. |
| RAISES | DESCRIPTION |
|---|---|
SchedulerNotRunningError
|
If the scheduler has not been started yet. |
MaximumInstancesError
|
If the task is already at its executor's concurrency limit. |
TaskLookupError
|
If the task cannot be found. |
KeyError
|
If the configured executor cannot be found. |
Source code in asyncz/schedulers/base.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | |
get_tasks
¶
Returns a list of pending tasks (if the scheduler hasn't been started yet) and scheduled tasks, either from a specific task store or from all of them.
If the scheduler has not been started yet, only pending tasks can be returned because the task stores haven't been started yet either.
| PARAMETER | DESCRIPTION |
|---|---|
store
|
alias of the task store.
TYPE:
|
Source code in asyncz/schedulers/base.py
get_task
¶
Returms the Task that matches the given task_id.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that most likely contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
get_task_info
¶
Return an immutable inspection snapshot for a single task.
The returned snapshot is safe to expose in operational tooling because it is detached from the underlying task object and captures only observable scheduler metadata.
Source code in asyncz/schedulers/base.py
get_task_infos
¶
get_task_infos(
store=None,
*,
schedule_state=None,
executor=None,
trigger=None,
q=None,
sort_by="next_run_time",
descending=False,
)
Return task snapshots with scheduler-native filtering and sorting.
This API is meant for read-oriented operational tooling. Instead of every consumer re-implementing its own serialization, filtering, and ordering logic, the scheduler exposes a single consistent view of task metadata.
| PARAMETER | DESCRIPTION |
|---|---|
store
|
Restrict results to one store alias.
TYPE:
|
schedule_state
|
Optional state filter. Accepts a
TYPE:
|
executor
|
Restrict results to one executor alias.
TYPE:
|
trigger
|
Restrict results to one trigger alias or trigger class name.
TYPE:
|
q
|
Case-insensitive free-text search across task identifiers, names, callable information, trigger metadata, executor, and state.
TYPE:
|
sort_by
|
Field to sort on. Supported values are
TYPE:
|
descending
|
Reverse the final sort order.
TYPE:
|
Source code in asyncz/schedulers/base.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | |
delete_task
¶
Removes a task, preventing it from being run anymore.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that most likely contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
remove_all_tasks
¶
Removes all tasks from the specified task store, or all task stores if none is given.
Source code in asyncz/schedulers/base.py
create_default_store
¶
lookup_executor
¶
Returns the executor instance by the given name from the list of executors that were added to this scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
The alias for the instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
lookup_store
¶
Returns the task store instance by the given name from the list of task stores that were added to this scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
The alias for the instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
lookup_task
¶
Finds a task by its ID.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The id of the task to lookup.
TYPE:
|
alias
|
Alias of a task store to look in.
|
Source code in asyncz/schedulers/base.py
dispatch_event
¶
Dispatches the given event to interested listeners.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
The SchedulerEvent to be sent.
TYPE:
|
Source code in asyncz/schedulers/base.py
create_lock
¶
process_tasks
¶
Iterates through tasks in every store, starts tasks that are due and figures out how long to wait for the next round.
If the get_due_tasks() call raises an exception, a new wakeup is scheduled in at least store_retry_interval seconds.
Source code in asyncz/schedulers/base.py
setup
¶
Reconfigures the scheduler with the given options. Can only be done when the scheduler isn't running.
| PARAMETER | DESCRIPTION |
|---|---|
global_config
|
a "global" configuration dictionary whose values can be overridden by keyword arguments to this method.
TYPE:
|
|
prefix: pick only those keys from global_config that are prefixed with this string (pass an empty string or None to use all keys).
|
Source code in asyncz/schedulers/base.py
inc_refcount
¶
decr_refcount
¶
handle_shutdown_coros
¶
asgi
¶
Return wrapper for asgi integration.
Source code in asyncz/schedulers/base.py
check_uwsgi
¶
Check if we are running under uWSGI with threads disabled.
Source code in asyncz/schedulers/base.py
real_add_task
¶
Adds the task.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
Task instance.
TYPE:
|
store_alias
|
The alias of the store to add the task to.
|
replace_existing
|
The flag indicating the replacement of the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
resolve_load_plugin
classmethod
¶
Resolve the plugin from its module and attrs.
Source code in asyncz/schedulers/base.py
create_plugin_instance
¶
Creates an instance of the given plugin type, loading the plugin first if necessary.
Source code in asyncz/schedulers/base.py
create_trigger
¶
Creates a trigger.
Source code in asyncz/schedulers/base.py
create_processing_lock
¶
Creates a non-reentrant lock object used to distribute between threads for processing.
asyncz.schedulers.asyncio.NativeAsyncIOScheduler
¶
Bases: AsyncIOScheduler
A scheduler that runs on an existing asyncio event loop.
This scheduler is typically to run with asyncio which means that any ASGI framework can also use it internally if needed. For example, Ravyn and Starlette.
| PARAMETER | DESCRIPTION |
|---|---|
isolated_event_loop
|
Use a fresh, isolated event_loop instead the existing.
|
Source code in asyncz/schedulers/base.py
running
property
¶
Return True if the scheduler has been started. This is a shortcut for scheduler.state != SchedulerState.STATE_STOPPED.
start
async
¶
Source code in asyncz/schedulers/asyncio.py
handle_shutdown_coros
¶
shutdown
async
¶
Source code in asyncz/schedulers/asyncio.py
pause
¶
Pause task processing in the scheduler.
This will prevent the scheduler from waking up to do task processing until resume is called. It will not however stop any already running task processing.
Source code in asyncz/schedulers/base.py
resume
¶
Resume task processing in the scheduler.
Source code in asyncz/schedulers/base.py
add_executor
¶
Source code in asyncz/schedulers/base.py
remove_executor
¶
Removes the executor by the given alias from this scheduler.
Source code in asyncz/schedulers/base.py
add_store
¶
Adds a task store to this scheduler.
Any extra keyword arguments will be passed to the task store plugin's constructor, assuming that the first argument is the name of a task store plugin.
Source code in asyncz/schedulers/base.py
remove_store
¶
Removes the task store by the given alias from this scheduler.
Source code in asyncz/schedulers/base.py
add_listener
¶
add_listener(callback, mask=EVENT_ALL)
Adds a listener for scheduler events.
When a matching event occurs, callback is executed with the event object as its sole argument. If the mask parameter is not provided, the callback will receive events of all types.
| PARAMETER | DESCRIPTION |
|---|---|
callback
|
any callable that takes one argument.
TYPE:
|
mask
|
bitmask that indicates which events should be listened to.
TYPE:
|
Source code in asyncz/schedulers/base.py
remove_listener
¶
Removes a previously added event listener.
Source code in asyncz/schedulers/base.py
add_task
¶
add_task(
fn_or_task=None,
trigger=None,
args=None,
kwargs=None,
id=None,
name=None,
mistrigger_grace_time=undefined,
coalesce=undefined,
max_instances=undefined,
next_run_time=undefined,
store=None,
executor=None,
replace_existing=False,
fn=None,
**trigger_args,
)
Adds the given task to the task list and wakes up the scheduler if it's already running.
Any option that defaults to undefined will be replaced with the corresponding default value when the task is scheduled (which happens when the scheduler is started, or immediately if the scheduler is already running).
The fn argument can be given either as a callable object or a textual reference in the package.module:some.object format, where the first half (separated by :) is an importable module and the second half is a reference to the callable object, relative to the module.
The trigger argument can either be
. The alias name of the trigger (e.g. date, interval or cron), in which case any extra keyword arguments to this method are passed on to the trigger's constructor. . An instance of a trigger class (TriggerType).
| PARAMETER | DESCRIPTION |
|---|---|
fn
|
Callable (or a textual reference to one) to run at the given time.
TYPE:
|
trigger
|
Trigger instance that determines when fn is called.
TYPE:
|
args
|
List of positional arguments to call fn with.
TYPE:
|
kwargs
|
Dict of keyword arguments to call fn with.
TYPE:
|
id
|
Explicit identifier for the task (for modifying it later).
TYPE:
|
name
|
Textual description of the task.
TYPE:
|
mistriger_grace_time
|
Seconds after the designated runtime that the task is still allowed to be run (or None to allow the task to run no matter how late it is).
|
coalesce
|
Run once instead of many times if the scheduler determines that the task should be run more than once in succession.
TYPE:
|
max_instances
|
Maximum number of concurrently running instances allowed for this task.
TYPE:
|
next_run_time
|
When to first run the task, regardless of the trigger (pass None to add the task as paused).
TYPE:
|
store
|
Alias of the task store to store the task in.
TYPE:
|
executor
|
Alias of the executor to run the task with.
TYPE:
|
replace_existing
|
True to replace an existing task with the same id (but retain the number of runs from the existing one).
TYPE:
|
Source code in asyncz/schedulers/base.py
478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 | |
update_task
¶
Modifies the properties of a single task.
Modifications are passed to this method as extra keyword arguments.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
reschedule_task
¶
Constructs a new trigger for a task and updates its next run time.
Extra keyword arguments are passed directly to the trigger's constructor.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
trigger
|
Alias of the trigger type or a trigger instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
pause_task
¶
Causes the given task not to be executed until it is explicitly resumed.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
resume_task
¶
Resumes the schedule of the given task, or removes the task if its schedule is finished.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
run_task
¶
Submit a task to its configured executor immediately.
This method centralizes the "run now" behavior that operational surfaces such as the CLI and dashboard need. It reuses the task's configured executor, dispatches the same submission-related events that the main scheduler loop emits, and persists the task's updated schedule state.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The task instance or identifier to execute immediately.
TYPE:
|
store
|
Optional preferred store alias when resolving the task.
TYPE:
|
force
|
When
TYPE:
|
remove_finished
|
When
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Union[TaskType, None]
|
The updated task when it remains scheduled or paused, or |
Union[TaskType, None]
|
it was removed because the schedule finished and |
Union[TaskType, None]
|
was requested. |
| RAISES | DESCRIPTION |
|---|---|
SchedulerNotRunningError
|
If the scheduler has not been started yet. |
MaximumInstancesError
|
If the task is already at its executor's concurrency limit. |
TaskLookupError
|
If the task cannot be found. |
KeyError
|
If the configured executor cannot be found. |
Source code in asyncz/schedulers/base.py
711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | |
get_tasks
¶
Returns a list of pending tasks (if the scheduler hasn't been started yet) and scheduled tasks, either from a specific task store or from all of them.
If the scheduler has not been started yet, only pending tasks can be returned because the task stores haven't been started yet either.
| PARAMETER | DESCRIPTION |
|---|---|
store
|
alias of the task store.
TYPE:
|
Source code in asyncz/schedulers/base.py
get_task
¶
Returms the Task that matches the given task_id.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that most likely contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
get_task_info
¶
Return an immutable inspection snapshot for a single task.
The returned snapshot is safe to expose in operational tooling because it is detached from the underlying task object and captures only observable scheduler metadata.
Source code in asyncz/schedulers/base.py
get_task_infos
¶
get_task_infos(
store=None,
*,
schedule_state=None,
executor=None,
trigger=None,
q=None,
sort_by="next_run_time",
descending=False,
)
Return task snapshots with scheduler-native filtering and sorting.
This API is meant for read-oriented operational tooling. Instead of every consumer re-implementing its own serialization, filtering, and ordering logic, the scheduler exposes a single consistent view of task metadata.
| PARAMETER | DESCRIPTION |
|---|---|
store
|
Restrict results to one store alias.
TYPE:
|
schedule_state
|
Optional state filter. Accepts a
TYPE:
|
executor
|
Restrict results to one executor alias.
TYPE:
|
trigger
|
Restrict results to one trigger alias or trigger class name.
TYPE:
|
q
|
Case-insensitive free-text search across task identifiers, names, callable information, trigger metadata, executor, and state.
TYPE:
|
sort_by
|
Field to sort on. Supported values are
TYPE:
|
descending
|
Reverse the final sort order.
TYPE:
|
Source code in asyncz/schedulers/base.py
873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 | |
delete_task
¶
Removes a task, preventing it from being run anymore.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier of the task.
TYPE:
|
store
|
Alias of the task store that most likely contains the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
remove_all_tasks
¶
Removes all tasks from the specified task store, or all task stores if none is given.
Source code in asyncz/schedulers/base.py
wakeup
¶
create_default_executor
¶
create_default_store
¶
lookup_executor
¶
Returns the executor instance by the given name from the list of executors that were added to this scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
The alias for the instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
lookup_store
¶
Returns the task store instance by the given name from the list of task stores that were added to this scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
The alias for the instance.
TYPE:
|
Source code in asyncz/schedulers/base.py
lookup_task
¶
Finds a task by its ID.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The id of the task to lookup.
TYPE:
|
alias
|
Alias of a task store to look in.
|
Source code in asyncz/schedulers/base.py
dispatch_event
¶
Dispatches the given event to interested listeners.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
The SchedulerEvent to be sent.
TYPE:
|
Source code in asyncz/schedulers/base.py
create_lock
¶
process_tasks
¶
Iterates through tasks in every store, starts tasks that are due and figures out how long to wait for the next round.
If the get_due_tasks() call raises an exception, a new wakeup is scheduled in at least store_retry_interval seconds.
Source code in asyncz/schedulers/base.py
setup
¶
Reconfigures the scheduler with the given options. Can only be done when the scheduler isn't running.
| PARAMETER | DESCRIPTION |
|---|---|
global_config
|
a "global" configuration dictionary whose values can be overridden by keyword arguments to this method.
TYPE:
|
|
prefix: pick only those keys from global_config that are prefixed with this string (pass an empty string or None to use all keys).
|
Source code in asyncz/schedulers/base.py
inc_refcount
¶
decr_refcount
¶
asgi
¶
Return wrapper for asgi integration.
Source code in asyncz/schedulers/base.py
check_uwsgi
¶
Check if we are running under uWSGI with threads disabled.
Source code in asyncz/schedulers/base.py
real_add_task
¶
Adds the task.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
Task instance.
TYPE:
|
store_alias
|
The alias of the store to add the task to.
|
replace_existing
|
The flag indicating the replacement of the task.
TYPE:
|
Source code in asyncz/schedulers/base.py
resolve_load_plugin
classmethod
¶
Resolve the plugin from its module and attrs.
Source code in asyncz/schedulers/base.py
create_plugin_instance
¶
Creates an instance of the given plugin type, loading the plugin first if necessary.
Source code in asyncz/schedulers/base.py
create_trigger
¶
Creates a trigger.
Source code in asyncz/schedulers/base.py
create_processing_lock
¶
Creates a non-reentrant lock object used to distribute between threads for processing.
start_timer
¶
Tasks¶
asyncz.tasks.base.Task
¶
Bases: BaseState, TaskType
Contains the options given when scheduling callables and its current schedule and other state. This class should never be instantiated by the user.
Args:
id: The unique identifier of this task.
name: The description of this task.
fn: The callable to execute.
args: Positional arguments to the callable.
kwargs: Keyword arguments to the callable.
coalesce: Whether to only run the task once when several run times are due.
trigger: The trigger object that controls the schedule of this task.
executor: The name of the executor that will run this task.
mistrigger_grace_time: The time (in seconds) how much this task's execution is allowed to
be late (`None` means "allow the task to run no matter how late it is").
max_instances: The maximum number of concurrently executing instances allowed for this
task.
next_run_time: The next scheduled run time of this task.
Source code in asyncz/tasks/base.py
schedule_state
property
¶
Return the scheduler-facing state of this task.
The state is derived entirely from the task metadata so it works for both live tasks and tasks reconstructed from stores:
- pending tasks have not yet been committed to a running store
- paused tasks have no
next_run_time - scheduled tasks have a future or due
next_run_time
paused
property
¶
Convenience flag used by management APIs and the dashboard.
This intentionally distinguishes paused tasks from pending tasks so the caller can tell whether a task is merely unscheduled or still waiting to be committed at scheduler start time.
model_config
class-attribute
instance-attribute
¶
get_run_times
¶
Computes the scheduled run times next_run_time and now, inclusive.
Source code in asyncz/tasks/base.py
update_task
¶
Validates the updates to the Task and makes the modifications if and only if all of them validate.
Source code in asyncz/tasks/base.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |
update
¶
Makes the given updates to this json and save it in the associated store. Accepted keyword args are the same as the class variables.
Source code in asyncz/tasks/types.py
reschedule
¶
Shortcut for switching the trigger on this task.
Source code in asyncz/tasks/types.py
pause
¶
Temporarily suspenses the execution of a given task.
Source code in asyncz/tasks/types.py
resume
¶
Resume the schedule of this task if previously paused.
Source code in asyncz/tasks/types.py
delete
¶
Unschedules this task and removes it from its associated store.
Source code in asyncz/tasks/types.py
snapshot
¶
Build an immutable inspection snapshot for this task.
The snapshot is the preferred representation for presentation-oriented code because it captures the task's observable state without exposing the live mutable task object.
Source code in asyncz/tasks/types.py
Triggers¶
asyncz.triggers.date.DateTrigger
¶
Bases: BaseTrigger
Triggers once on the given datetime. If run_at is left empty then the current time is used.
| PARAMETER | DESCRIPTION |
|---|---|
run_at
|
The date/time to run the task at.
TYPE:
|
timezone
|
The time zone for the run_at if it does not have one already.
TYPE:
|
Source code in asyncz/triggers/date.py
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_next_trigger_time
¶
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
asyncz.triggers.interval.IntervalTrigger
¶
IntervalTrigger(
weeks=0,
days=0,
hours=0,
minutes=0,
seconds=0,
start_at=None,
end_at=None,
timezone=None,
jitter=None,
**kwargs,
)
Bases: BaseTrigger
Triggers on a specific intervals, starting on start_at if specified or datetime.now() + interval otherwise.
| PARAMETER | DESCRIPTION |
|---|---|
weeks
|
Number of weeks to wait.
TYPE:
|
days
|
Number of days to wait.
TYPE:
|
hours
|
Number of hours to wait.
TYPE:
|
minutes
|
Number of minutes to wait.
TYPE:
|
seconds
|
Number of seconds to wait.
TYPE:
|
start_at
|
Starting point for the interval calculation.
TYPE:
|
end_at
|
Latest possible date/time to trigger on.
TYPE:
|
timezone
|
Time zone to use gor the date/time calculations.
TYPE:
|
jitter
|
Delay the task execution by jitter seconds at most.
TYPE:
|
Source code in asyncz/triggers/interval.py
interval
instance-attribute
¶
start_at
instance-attribute
¶
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_next_trigger_time
¶
Source code in asyncz/triggers/interval.py
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
asyncz.triggers.cron.trigger.CronTrigger
¶
CronTrigger(
year=None,
month=None,
day=None,
week=None,
day_of_week=None,
hour=None,
minute=None,
second=None,
start_at=None,
end_at=None,
timezone=None,
jitter=None,
**kwargs,
)
Bases: BaseTrigger
Triggers when the current time matches all specified time constraints. Very simlar to the way UNIX cron scheduler works.
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
│ │ │ │ │ 7 is also Sunday on some systems)
│ │ │ │ │
│ │ │ │ │
* * * * *
| PARAMETER | DESCRIPTION |
|---|---|
year
|
4-digit value.
TYPE:
|
month
|
Month (1-12).
TYPE:
|
day
|
Day of the month (1-31).
TYPE:
|
week
|
ISO week (1-53).
TYPE:
|
day_of_week
|
Number or name of weekday (0-6 or mon,tue,wed,thu,fri,sat,sun).
TYPE:
|
hour
|
Hour (0-23).
TYPE:
|
minute
|
Minute (0-59).
TYPE:
|
second
|
Second (0-59).
TYPE:
|
start_at
|
Earliest possible date/time to trigger on (inclusive).
TYPE:
|
end_at
|
Latest possible date/time to trier on (inclusive).
TYPE:
|
timezone
|
Time zone to use for the date/time calculations (defaults to scheduler timezone).
TYPE:
|
jitter
|
Delay the task executions by jitter seconds at most.
TYPE:
|
The first day of the week is always monday.
Source code in asyncz/triggers/cron/trigger.py
field_names
instance-attribute
¶
fields_map
instance-attribute
¶
fields_map = {
"year": BaseField,
"month": MonthField,
"week": WeekField,
"day": DayOfMonthField,
"day_of_week": DayOfWeekField,
"hour": BaseField,
"minute": BaseField,
"second": BaseField,
}
start_at
instance-attribute
¶
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
from_crontab
classmethod
¶
Creates a class CronTrigger from a standard crontab expression. See https://en.wikipedia.org/wiki/Cron for more information on the format accepted here.
Source code in asyncz/triggers/cron/trigger.py
increment_field_value
¶
Increments the designated field and resets all significant fields to their minimum values
Source code in asyncz/triggers/cron/trigger.py
set_field_value
¶
Source code in asyncz/triggers/cron/trigger.py
get_next_trigger_time
¶
Source code in asyncz/triggers/cron/trigger.py
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
asyncz.triggers.combination.AndTrigger
¶
Bases: BaseCombinationTrigger
Always returns the earliest next trigger time that all the passed triggers agree on. The trigger is consideres to be finished when any of the given triggers finished its schedule.
| PARAMETER | DESCRIPTION |
|---|---|
triggers
|
List of triggers to combine.
TYPE:
|
jitter
|
Delay the task execution by the jitter seconds at most.
TYPE:
|
Source code in asyncz/triggers/base.py
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_next_trigger_time
¶
Source code in asyncz/triggers/combination.py
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
asyncz.triggers.combination.OrTrigger
¶
Bases: BaseCombinationTrigger
Always returns the earliest next trigger time produced by any of the given triggers. The trigger is considered finished when all the given triggers have finished their schedules.
| PARAMETER | DESCRIPTION |
|---|---|
triggers
|
List of triggers to combine.
TYPE:
|
jitter
|
Delay the task execution by the jitter seconds at most.
TYPE:
|
Source code in asyncz/triggers/base.py
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_next_trigger_time
¶
Source code in asyncz/triggers/combination.py
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
asyncz.triggers.shutdown.ShutdownTrigger
¶
Bases: BaseTrigger
allow_mistrigger_by_default
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_next_trigger_time
¶
apply_jitter
¶
Makes the next trigger time random by ading a random value (jitter).
| PARAMETER | DESCRIPTION |
|---|---|
next_trigger_time
|
The next triger time without the jitter.
TYPE:
|
jitter
|
The maximum number of second to add to the next_trigger_time.
TYPE:
|
now
|
The next trigger time with the jitter.
TYPE:
|
Source code in asyncz/triggers/base.py
Executors¶
asyncz.executors.asyncio.AsyncIOExecutor
¶
Bases: BaseExecutor
Executor used for AsyncIO, typically can also be plugged into any ASGI framework as well, for example, Ravyn, Starlette, or FastAPI.
Runs the task in the default executor event loop.
If the task function is a native coroutine function, it is scheduled to be run directly in the event loop as soon as possible. All other functions are run in the event loop's default executor which is usually a thread pool.
start
¶
shutdown
¶
do_send_task
¶
Source code in asyncz/executors/asyncio.py
send_task
¶
Sends the task for execution.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
A Task instance to execute.
TYPE:
|
run_times
|
A list of datetimes specifying when the task should have been run.
TYPE:
|
Source code in asyncz/executors/base.py
run_task_success
¶
Called by the executor with the list of generated events when the function run_task has been successfully executed.
Source code in asyncz/executors/base.py
run_task_error
¶
Called by the executor with the exception if there is an error calling the run_task.
Source code in asyncz/executors/base.py
asyncz.executors.pool.ThreadPoolExecutor
¶
Bases: BasePoolExecutor
An executor that runs tasks in a concurrent.futures thread pool.
| PARAMETER | DESCRIPTION |
|---|---|
max_workers
|
The maximum number of spawned threads.
TYPE:
|
pool_kwargs
|
Dict of keyword arguments to pass to the underlying ThreadPoolExecutor constructor.
TYPE:
|
Source code in asyncz/executors/pool.py
model_config
class-attribute
instance-attribute
¶
start
¶
Called by the scheduler when the scheduler is being started or when the executor is being added to an already running scheduler.
Source code in asyncz/executors/base.py
shutdown
¶
send_task
¶
Sends the task for execution.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
A Task instance to execute.
TYPE:
|
run_times
|
A list of datetimes specifying when the task should have been run.
TYPE:
|
Source code in asyncz/executors/base.py
do_send_task
¶
Source code in asyncz/executors/pool.py
run_task_success
¶
Called by the executor with the list of generated events when the function run_task has been successfully executed.
Source code in asyncz/executors/base.py
run_task_error
¶
Called by the executor with the exception if there is an error calling the run_task.
Source code in asyncz/executors/base.py
asyncz.executors.process_pool.ProcessPoolExecutor
¶
Bases: BasePoolExecutor
An executor that runs tasks in a concurrent.futures process pool.
| PARAMETER | DESCRIPTION |
|---|---|
max_workers
|
The maximum number of spawned processes.
TYPE:
|
pool_kwargs
|
Dict of keyword arguments to pass to the underlying ProcessPoolExecutor constructor.
TYPE:
|
Source code in asyncz/executors/process_pool.py
model_config
class-attribute
instance-attribute
¶
start
¶
Source code in asyncz/executors/process_pool.py
shutdown
¶
send_task
¶
Sends the task for execution.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
A Task instance to execute.
TYPE:
|
run_times
|
A list of datetimes specifying when the task should have been run.
TYPE:
|
Source code in asyncz/executors/base.py
do_send_task
¶
Source code in asyncz/executors/pool.py
run_task_success
¶
Called by the executor with the list of generated events when the function run_task has been successfully executed.
Source code in asyncz/executors/base.py
run_task_error
¶
Called by the executor with the exception if there is an error calling the run_task.
Source code in asyncz/executors/base.py
asyncz.executors.debug.DebugExecutor
¶
Bases: BaseExecutor
A special executor that executes the target callable directly instead of deferring it to a thread or process.
do_send_task
¶
Source code in asyncz/executors/debug.py
start
¶
Called by the scheduler when the scheduler is being started or when the executor is being added to an already running scheduler.
Source code in asyncz/executors/base.py
shutdown
¶
send_task
¶
Sends the task for execution.
| PARAMETER | DESCRIPTION |
|---|---|
task
|
A Task instance to execute.
TYPE:
|
run_times
|
A list of datetimes specifying when the task should have been run.
TYPE:
|
Source code in asyncz/executors/base.py
run_task_success
¶
Called by the executor with the list of generated events when the function run_task has been successfully executed.
Source code in asyncz/executors/base.py
run_task_error
¶
Called by the executor with the exception if there is an error calling the run_task.
Source code in asyncz/executors/base.py
Stores¶
asyncz.stores.memory.MemoryStore
¶
Bases: BaseStore
Stores tasks in an array in RAM. Provides no persistance support.
Source code in asyncz/stores/memory.py
model_config
class-attribute
instance-attribute
¶
lookup_task
¶
get_task
¶
Return the task by id or raise TaskLookupError if it's missing.
This mirrors the expected BaseStore API used by dashboard helpers that probe stores for task membership.
Source code in asyncz/stores/memory.py
get_due_tasks
¶
Source code in asyncz/stores/memory.py
get_next_run_time
¶
get_all_tasks
¶
add_task
¶
Source code in asyncz/stores/memory.py
update_task
¶
Source code in asyncz/stores/memory.py
delete_task
¶
Source code in asyncz/stores/memory.py
remove_all_tasks
¶
shutdown
¶
get_task_index
¶
Returns the index of the given task, or if it's not found, the index where the task should be inserted based on the given timestamp.
Source code in asyncz/stores/memory.py
start
¶
Called by the scheduler when the scheduler is being started or when the task store is being added to an already running scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
scheduler
|
The scheduler that is starting this task store.
TYPE:
|
alias
|
Alias of this task store as it was assigned to the scheduler.
TYPE:
|
Source code in asyncz/stores/base.py
create_lock
¶
Creates a lock protector.
Source code in asyncz/stores/base.py
conditional_decrypt
¶
conditional_encrypt
¶
fix_paused_tasks
¶
asyncz.stores.file.FileStore
¶
FileStore(
directory,
suffix=".task",
mode=448,
cleanup_directory=False,
pickle_protocol=HIGHEST_PROTOCOL,
**kwargs,
)
Bases: BaseStore
Stores tasks via sqlalchemy in a database.
Source code in asyncz/stores/file.py
forbidden_characters
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
check_task_id
¶
Source code in asyncz/stores/file.py
start
¶
When starting omits from the index any documents that lack next_run_time field.
Source code in asyncz/stores/file.py
shutdown
¶
lookup_task
¶
Source code in asyncz/stores/file.py
rebuild_task
¶
Source code in asyncz/stores/file.py
get_due_tasks
¶
get_tasks
¶
Source code in asyncz/stores/file.py
get_next_run_time
¶
Source code in asyncz/stores/file.py
get_all_tasks
¶
add_task
¶
Source code in asyncz/stores/file.py
update_task
¶
Source code in asyncz/stores/file.py
delete_task
¶
remove_all_tasks
¶
create_lock
¶
Creates a lock protector.
Source code in asyncz/stores/base.py
conditional_decrypt
¶
conditional_encrypt
¶
fix_paused_tasks
¶
asyncz.stores.mongo.MongoDBStore
¶
MongoDBStore(
database="asyncz",
collection="tasks",
client=None,
pickle_protocol=HIGHEST_PROTOCOL,
**kwargs,
)
Bases: BaseStore
Stores tasks in a Mongo database instance. Any remaining kwargs are passing directly to the mongo client.
Source code in asyncz/stores/mongo.py
model_config
class-attribute
instance-attribute
¶
start
¶
When starting omits from the index any documents that lack next_run_time field.
lookup_task
¶
rebuild_task
¶
Source code in asyncz/stores/mongo.py
get_due_tasks
¶
get_tasks
¶
Source code in asyncz/stores/mongo.py
get_next_run_time
¶
Source code in asyncz/stores/mongo.py
get_all_tasks
¶
add_task
¶
Source code in asyncz/stores/mongo.py
update_task
¶
Source code in asyncz/stores/mongo.py
delete_task
¶
remove_all_tasks
¶
shutdown
¶
create_lock
¶
Creates a lock protector.
Source code in asyncz/stores/base.py
conditional_decrypt
¶
conditional_encrypt
¶
fix_paused_tasks
¶
asyncz.stores.redis.RedisStore
¶
RedisStore(
database=0,
tasks_key="asyncz.tasks",
run_times_key="asyncz.run_times",
pickle_protocol=HIGHEST_PROTOCOL,
**kwargs,
)
Bases: BaseStore
Stores tasks in a Redis instance. Any remaining kwargs are passing directly to the redis instance.
Source code in asyncz/stores/redis.py
model_config
class-attribute
instance-attribute
¶
lookup_task
¶
rebuild_task
¶
Source code in asyncz/stores/redis.py
get_due_tasks
¶
Source code in asyncz/stores/redis.py
rebuild_tasks
¶
Source code in asyncz/stores/redis.py
get_next_run_time
¶
get_all_tasks
¶
Source code in asyncz/stores/redis.py
add_task
¶
Source code in asyncz/stores/redis.py
update_task
¶
Source code in asyncz/stores/redis.py
delete_task
¶
Source code in asyncz/stores/redis.py
remove_all_tasks
¶
shutdown
¶
start
¶
Called by the scheduler when the scheduler is being started or when the task store is being added to an already running scheduler.
| PARAMETER | DESCRIPTION |
|---|---|
scheduler
|
The scheduler that is starting this task store.
TYPE:
|
alias
|
Alias of this task store as it was assigned to the scheduler.
TYPE:
|
Source code in asyncz/stores/base.py
create_lock
¶
Creates a lock protector.
Source code in asyncz/stores/base.py
conditional_decrypt
¶
conditional_encrypt
¶
fix_paused_tasks
¶
asyncz.stores.sqlalchemy.SQLAlchemyStore
¶
Bases: BaseStore
Stores tasks via sqlalchemy in a database.
Source code in asyncz/stores/sqlalchemy.py
table
instance-attribute
¶
table = Table(
tablename,
metadata,
Column(
"id",
String(length=255),
primary_key=True,
nullable=False,
),
Column("next_run_time", BigInteger(), nullable=True),
Column("state", LargeBinary(), nullable=False),
)
model_config
class-attribute
instance-attribute
¶
start
¶
When starting omits from the index any documents that lack next_run_time field.
shutdown
¶
lookup_task
¶
rebuild_task
¶
Source code in asyncz/stores/sqlalchemy.py
get_due_tasks
¶
get_tasks
¶
Source code in asyncz/stores/sqlalchemy.py
get_next_run_time
¶
Source code in asyncz/stores/sqlalchemy.py
get_all_tasks
¶
add_task
¶
Source code in asyncz/stores/sqlalchemy.py
update_task
¶
Source code in asyncz/stores/sqlalchemy.py
delete_task
¶
Source code in asyncz/stores/sqlalchemy.py
remove_all_tasks
¶
create_lock
¶
Creates a lock protector.
Source code in asyncz/stores/base.py
conditional_decrypt
¶
conditional_encrypt
¶
fix_paused_tasks
¶
Events¶
asyncz.events.base.SchedulerEvent
¶
Bases: BaseModel
The event itself.
| PARAMETER | DESCRIPTION |
|---|---|
code
|
The code type for the event
|
alias
|
The alias given to store or executor.
|
asyncz.events.base.TaskEvent
¶
Bases: SchedulerEvent
The events for a specific task.
| PARAMETER | DESCRIPTION |
|---|---|
task_id
|
The identifier given to a task.
|
store
|
The alias given to a store.
|
asyncz.events.base.TaskSubmissionEvent
¶
Bases: TaskEvent
Event related to the submission of a task.
| PARAMETER | DESCRIPTION |
|---|---|
scheduled_run_times
|
List of datetimes when the task is supposed to run.
|
model_config
class-attribute
instance-attribute
¶
asyncz.events.base.TaskExecutionEvent
¶
Bases: TaskEvent
Event relared to the running of a task within the executor.
| PARAMETER | DESCRIPTION |
|---|---|
scheduled_run_times
|
The time when the task was scheduled to be run.
|
return_value
|
The return value of the task successfully executed.
|
exception
|
The exception raised by the task.
|
traceback
|
A formated traceback for the exception.
|