Constructor
new Scheduler(psychoJS)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
psychoJS |
module:core.PsychoJS | the PsychoJS instance |
Members
(static, readonly) Event :Symbol
- Source:
Properties:
Name | Type | Description |
---|---|---|
NEXT |
Symbol | Move onto the next task without rendering the scene first. |
FLIP_REPEAT |
Symbol | Render the scene and repeat the task. |
FLIP_NEXT |
Symbol | Render the scene and move onto the next task. |
QUIT |
Symbol | Quit the scheduler. |
Events.
Type:
- Symbol
(static, readonly) Status :Symbol
- Source:
Properties:
Name | Type | Description |
---|---|---|
RUNNING |
Symbol | The Scheduler is running. |
STOPPED |
Symbol | The Scheduler is stopped. |
Status.
Type:
- Symbol
status
- Source:
Get the status of the scheduler.
Methods
add(task, …args)
- Source:
Schedule a new task.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
task |
Scheduler~Task | Scheduler | the task to be scheduled |
|
args |
* |
<repeatable> |
arguments for that task |
addConditional(condition, thenScheduler, elseScheduler)
- Source:
Schedule a series of task or another, based on a condition.
Note: the tasks are sub-schedulers
.
Parameters:
Name | Type | Description |
---|---|---|
condition |
Scheduler~Condition | the condition |
thenScheduler |
Scheduler | the |
elseScheduler |
Scheduler | the |
(async) start()
- Source:
Start this scheduler.
Note: tasks are run after each animation frame.
stop()
- Source:
Stop this scheduler.
Type Definitions
Condition() → {boolean}
- Source:
Condition evaluated when the task is run.
Returns:
- Type
- boolean
Task(argsopt)
- Source:
Task to be run by the scheduler.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
* |
<optional> |
optional arguments |