Pulsar v0.1.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

Updates an existing job in the dashboard, returning a modified dashboard

Link to this section Functions

Link to this function add_job(dashboard, jobid) View Source

Add a new job to the dashboard.

Returns the dashboard unchanged if the jobid already exists.

Link to this function clear_inactive(dashboard) View Source

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.

Link to this function complete_job(dashboard, jobid) View Source

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.

Link to this function new_dashboard(active_highlight_duration) View Source

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.

Link to this function update_job(dashboard, jobid, job_data) View Source

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
  • :status - an atom, one of :normal, :error, or :ok

Returns the updated dashboard.