This is the simple-tasks Reference Manual, version 1.3.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:42:44 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
simple-tasks
A very simple task scheduling framework.
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/simple-tasks.git)
zlib
1.3.0
bordeaux-threads
(system).
array-utils
(system).
dissect
(system).
package.lisp
(file).
toolkit.lisp
(file).
status.lisp
(file).
runner.lisp
(file).
task.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
simple-tasks/simple-tasks.asd
simple-tasks/package.lisp
simple-tasks/toolkit.lisp
simple-tasks/status.lisp
simple-tasks/runner.lisp
simple-tasks/task.lisp
simple-tasks/documentation.lisp
simple-tasks/toolkit.lisp
package.lisp
(file).
simple-tasks
(system).
+no-threading-stump+
(special variable).
no-threading-stump
(class).
print-object
(method).
simple-tasks/status.lisp
toolkit.lisp
(file).
simple-tasks
(system).
+status-ended+
(special variable).
+status-running+
(special variable).
+status-started+
(special variable).
status
(generic reader).
(setf status)
(writer method).
status
(type).
status-object
(class).
status=
(generic function).
status-list-p
(function).
simple-tasks/runner.lisp
status.lisp
(file).
simple-tasks
(system).
*runner*
(special variable).
back-queue
(generic reader).
cvar
(generic reader).
interrupt-task
(generic function).
lock
(generic reader).
make-runner-thread
(function).
print-object
(method).
queue
(generic reader).
queued-runner
(class).
run-task
(generic function).
runner
(reader method).
(setf runner)
(writer method).
runner
(class).
runner-condition
(condition).
runner-not-started
(condition).
runner-not-stopped
(condition).
schedule-task
(generic function).
start-runner
(generic function).
stop-runner
(generic function).
thread
(generic reader).
%set-back-queue
(writer method).
%set-queue
(writer method).
%set-thread
(writer method).
*current-queue*
(special variable).
*current-task*
(special variable).
simple-tasks/task.lisp
runner.lisp
(file).
simple-tasks
(system).
await
(generic function).
blocking-call-task
(class).
blocking-task
(class).
call-as-task
(function).
call-task
(class).
callback
(generic reader).
(setf callback)
(writer method).
callback-task
(class).
cvar
(reader method).
(setf cvar)
(writer method).
error-environment
(generic reader).
(setf error-environment)
(writer method).
func
(generic reader).
(setf func)
(writer method).
interrupt-task
(method).
interrupt-task
(method).
lock
(reader method).
(setf lock)
(writer method).
notifying-task
(class).
print-object
(method).
print-object
(method).
return-values
(generic function).
(setf return-values)
(writer method).
run-task
(method).
run-task
(method).
run-task
(method).
run-task
(method).
runner
(generic reader).
(setf runner)
(writer method).
schedule-task
(method).
schedule-task
(method).
schedule-task
(method).
schedule-task
(method).
task
(generic reader).
(setf task)
(writer method).
task
(class).
task-already-scheduled
(condition).
task-condition
(condition).
task-errored
(condition).
task-ready-p
(generic function).
with-body-as-task
(macro).
simple-tasks/documentation.lisp
task.lisp
(file).
simple-tasks
(system).
Packages are listed by definition order.
simple-tasks
org.shirakumo.simple-tasks
common-lisp
.
*runner*
(special variable).
+no-threading-stump+
(special variable).
+status-ended+
(special variable).
+status-running+
(special variable).
+status-started+
(special variable).
await
(generic function).
back-queue
(generic reader).
blocking-call-task
(class).
blocking-task
(class).
call-as-task
(function).
call-task
(class).
callback
(generic reader).
(setf callback)
(generic writer).
callback-task
(class).
cvar
(generic reader).
(setf cvar)
(generic writer).
error-environment
(generic reader).
(setf error-environment)
(generic writer).
func
(generic reader).
(setf func)
(generic writer).
interrupt-task
(generic function).
lock
(generic reader).
(setf lock)
(generic writer).
make-runner-thread
(function).
no-threading-stump
(class).
notifying-task
(class).
queue
(generic reader).
queued-runner
(class).
return-values
(generic function).
(setf return-values)
(generic writer).
run-task
(generic function).
runner
(generic reader).
(setf runner)
(generic writer).
runner
(class).
runner-condition
(condition).
runner-not-started
(condition).
runner-not-stopped
(condition).
schedule-task
(generic function).
start-runner
(generic function).
status
(generic reader).
(setf status)
(generic writer).
status
(type).
status-object
(class).
status=
(generic function).
stop-runner
(generic function).
task
(generic reader).
(setf task)
(generic writer).
task
(class).
task-already-scheduled
(condition).
task-condition
(condition).
task-errored
(condition).
task-ready-p
(generic function).
thread
(generic reader).
with-body-as-task
(macro).
%set-back-queue
(generic writer).
%set-queue
(generic writer).
%set-thread
(generic writer).
*current-queue*
(special variable).
*current-task*
(special variable).
checkdocs
(function).
setdocs
(macro).
status-list-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Bound to the current runner if within a runner context. Otherwise, set to NIL. Useful to detect if a task is run in a particular runner to avoid conflicts.
Constant to hold an instance of NO-THREADING-STUMP.
Constant matching any ended (not necessarily successful) status.
:STOPPING Object is in the process of being stopped.
:STOPPED Object has been stopped.
:COMPLETED Object successfully completed execution.
:ERRORED Object ended execution with an error.
Constant matching a running status.
:RUNNING Object is currently executing.
Constant matching any started (not necessarily running) status.
:CREATED Object has been initialized, but not started. :SCHEDULED Object has been scheduled for execution. :RUNNING Object is currently executing.
Evaluate BODY within a task, usually a BLOCKING-CALL-TASK.
See CALL-AS-TASK
Call function within a task, usually a BLOCKING-CALL-TASK.
Depending on the task’s STATUS after SCHEDULE-TASK returns, the following happens.
:COMPLETED The task’s return values are returned.
:ERRORED A condition of type TASK-ERRORED is signalled.
T The task is returned.
See SCHEDULE-TASK
See BLOCKING-CALL-TASK
Make a thread to call START-RUNNER on RUNNER in.
On platforms with thread support, this returns the new thread.
On platforms without, this simply calls START-RUNNER and returns NIL.
See START-RUNNER
Wait for the TASK to match a certain STATUS.
On systems without thread support this does nothing.
See STATUS=
notifying-task
) status) ¶The current back-queue of the runner.
Used to swap with QUEUE when events are handled.
See QUEUE
queued-runner
)) ¶automatically generated reader method
The function to call upon completion of the task.
See CALLBACK-TASK
callback-task
)) ¶automatically generated reader method
callback-task
)) ¶automatically generated writer method
The condition variable used to exchange signals.
See QUEUED-RUNNER
See BLOCKING-CALL-TASK
notifying-task
)) ¶automatically generated reader method
queued-runner
)) ¶automatically generated reader method
cvar
.
notifying-task
)) ¶automatically generated writer method
An environment object that is stored in case the task fails to run properly.
See DISSECT:ENVIRONMENT
The function the call-task calls once it is run.
See CALL-TASK
Interrupt the TASK to stop it from execution on RUNNER.
If the task is currently on the RUNNER’s queue to be executed (:SCHEDULED), it is removed from the queue. If the task is currently running, it is forcibly aborted. In either case, the task’s status is changed to :STOPPED and it will not execute further. On systems without thread support this does nothing.
If this is called with the RUNNER being T, the current runner of the TASK is used, if possible. If this is called with the RUNNER being NIL, the actual termination mechanism for the task is performed, leading it to be terminated.
queued-runner
)) ¶The lock used to coordinate task scheduling with the runner.
See QUEUED-RUNNER
notifying-task
)) ¶automatically generated reader method
queued-runner
)) ¶automatically generated reader method
lock
.
notifying-task
)) ¶automatically generated writer method
The current task queue of the runner.
Do not directly push tasks to this! Use SCHEDULE-TASK instead.
This queue is also NOT indicative of which tasks have yet to be run,
or which ones have. When the queued runner runs, it retains the current
queue for processing and sets a new, empty queue on the runner. As such,
when you look at the queue at any particular moment, tasks that are not
in it might not have run yet.
queued-runner
)) ¶automatically generated reader method
Returns the values that the call returned.
See CALL-TASK
Run the given task object directly.
One restart is established:
STOP to forcibly stop (interrupt) the task. Assigns the :STOPPED status.
callback-task
)) ¶notifying-task
)) ¶The runner the task is scheduled on.
See TASK
runner-condition
)) ¶runner-condition
)) ¶Schedule the task object for running.
The task may or may not be run immediately, depending on the runner and given
system support. Tasks are guaranteed to be run in the same order as they are
scheduled.
See RUN-TASK
blocking-task
) runner) ¶blocking-task
) runner) ¶blocking-task
) runner) ¶queued-runner
)) ¶Start the the runner.
queued-runner
)) ¶Current status indicator of the status-object.
status-object
)) ¶automatically generated reader method
status-object
)) ¶automatically generated writer method
Compare two statuses with each other (commutative).
list
) (b list
)) ¶status-object
)) ¶list
) (a status-object
)) ¶status-object
) b) ¶status-object
) (b list
)) ¶status-object
) (b status-object
)) ¶Stop the the runner.
queued-runner
)) ¶The task related to the condition.
task-condition
)) ¶task
.
task-condition
)) ¶Returns T if the task is ready to be run.
Returns the current thread associated with the queued-runner if any.
See QUEUED-RUNNER
queued-runner
)) ¶automatically generated reader method
no-threading-stump
) stream) ¶Condition superclass for conditions related to runner operations.
condition
.
Initarg | Value |
---|---|
:runner | (error runner required.) |
:runner
Condition signalled when the runner is not yet started, but has to be.
error
.
runner-condition
.
Condition signalled when the runner did not stop properly.
runner-condition
.
warning
.
Condition signalled when attempting to reschedule an already scheduled task.
error
.
task-condition
.
Condition superclass for task operation related conditions.
Condition signalled when a task failed to run properly.
task-condition
.
warning
.
Task class to perform a function call once run. Blocks the scheduling thread until it is done.
See CALL-TASK
See BLOCKING-TASK
A task that will block after being scheduled until it is done or interrupted.
When SCHEDULE-TASK is called on this, it establishes two restarts:
ABORT to forcibly abort (interrupt) the task.
UNBLOCK to resume execution in the current thread and leave the task running.
If a restart or similar exit functionality is invoked that leaves the scope of
SCHEDULE-TASK, the task is interrupted.
Note that the restarts are not useful on systems without thread support. In such
a case the task will be interrupted either way, due to the very nature of running
in the current thread.
See AWAIT
See INTERRUPT-TASK
See NOTIFYING-TASK
Task class to perform a function call once run. Stores the return values.
Task class to perform a function call once run and call a callback upon completion.
If the task completes successfully, the callback function is called with each return
value as an argument. Note that the callback function is called within the runner
environment which may be different from the scheduler environment.
See CALL-TASK
Initarg | Value |
---|---|
:callback | (error callback required.) |
:callback
Stump class to stand in place of a value on systems without threading support.
A task that will notify a condition upon completion.
This is particularly useful in conjunction with AWAIT.
task
.
await
.
(setf cvar)
.
cvar
.
(setf lock)
.
lock
.
run-task
.
Initarg | Value |
---|---|
:lock | (make-lock notifying-task) |
:cvar | (make-condition-variable name notifying-task) |
Queued runner. Runs tasks in a thread if threading is available. Noe that START-RUNNER for this runner will block the current thread.
Initarg | Value |
---|---|
:queue | (make-array 100 adjustable t fill-pointer 0) |
:back-queue | (make-array 100 adjustable t fill-pointer 0) |
:lock | (make-lock task-runner-queue-lock) |
:cvar | (make-condition-variable name task-runner-condition) |
:thread | nil |
:queue
:back-queue
:thread
Basic runner. Runs task as soon as scheduled.
A class that has a status.
:created
Basic task class.
A status can be a SYMBOL, a STATUS-OBJECT, or a LIST composed of SYMBOLs.
Bound to either NIL or the current queue being processed by the queued-runner.
See QUEUED-RUNNER
Bound to either NIL or the current task being processed by the queued-runner.
Check that all functions, classes, and variables have docstrings.
Returns true if every element in the list is a symbol and the list thus qualifies as a STATUS.
queued-runner
) queued-runner) ¶automatically generated writer method
queued-runner
) queued-runner) ¶automatically generated writer method
queued-runner
) queued-runner) ¶automatically generated writer method
Jump to: | %
(
A B C E F G I L M P Q R S T W |
---|
Jump to: | %
(
A B C E F G I L M P Q R S T W |
---|
Jump to: | *
+
B C E F L Q R S T |
---|
Jump to: | *
+
B C E F L Q R S T |
---|
Jump to: | B C D F N P Q R S T |
---|
Jump to: | B C D F N P Q R S T |
---|