Pulsar v0.2.0 Pulsar.Dashboard View Source
The logic for managing a set of jobs and updating them.
Link to this section Summary
Functions
Add a new job to the dashboard
Invoked periodically to clear the active flag of any job that has not been updated recently. Inactive jobs are marked dirty, to force a redisplay
Marks a job as completed. Completed jobs float to the top of the list, above any non-completed jobs. Once marked as complete, a job is removed from the dashboard at the next flush
Identify jobs that are ‘dirty’ (have pending updates) and redraws just those jobs in the dashboard
Creates a new, empty dashboard
A variant of flush used to temporarily shut down the dashboard before some other output
Updates an existing job in the dashboard, returning a modified dashboard
Link to this section Functions
Add a new job to the dashboard.
Returns the dashboard unchanged if the jobid already exists.
Invoked periodically to clear the active flag of any job that has not been updated recently. Inactive jobs are marked dirty, to force a redisplay.
Marks a job as completed. Completed jobs float to the top of the list, above any non-completed jobs. Once marked as complete, a job is removed from the dashboard at the next flush.
Returns the updated dashboard, or the input dashboard if the job doesn’t exist or is already completed.
Identify jobs that are ‘dirty’ (have pending updates) and redraws just those jobs in the dashboard.
Returns a tuple of the updated dashboard and a enum of strings to send to IO.write
.
Creates a new, empty dashboard.
active_highlight_duration
is the number of milliseconds that a newly added or updated job
should be rendered as active (bright). clear_inactive
is used periodically to identify
jobs that should be downgraded to inactive and re-rendered.
A variant of flush used to temporarily shut down the dashboard before some other output.
Returns a tuple of the updated dashboard, and output.
The output moves the cursor to the top line of the dashboard, then clears to the end of the screen. This temporarily removes the dashboard from visibility, so that other output can be produced.
The returned dashboard is configured so that the next call to flush/1
will add new lines for all jobs, and repaint all lines (e.g., as if
every job was freshly added).
Updates an existing job in the dashboard, returning a modified dashboard.
If the job does not exist, or is marked completed, the dashboard is returned unchanged.
job_data
is a keyword list of changes to make to the job. Supported keys are:
:message
- a string:prefix
- a string:status
- an atom, one of:normal
,:error
, or:ok
Returns the updated dashboard.