Liking cljdoc? Tell your friends :D

boundary.jobs.core.job

Core business logic for job management.

Pure functions for creating, updating, and managing background jobs. No side effects - all I/O happens in the shell layer.

Core business logic for job management.

Pure functions for creating, updating, and managing background jobs.
No side effects - all I/O happens in the shell layer.
raw docstring

aggregate-statsclj

(aggregate-stats jobs)

Calculate aggregate statistics for jobs.

Args: jobs - Collection of jobs

Returns: Stats map with counts and averages

Calculate aggregate statistics for jobs.

Args:
  jobs - Collection of jobs

Returns:
  Stats map with counts and averages
sourceraw docstring

calculate-durationclj

(calculate-duration job)

Calculate job execution duration.

Args: job - Job map

Returns: Duration in milliseconds or nil if not completed

Calculate job execution duration.

Args:
  job - Job map

Returns:
  Duration in milliseconds or nil if not completed
sourceraw docstring

calculate-retry-delayclj

(calculate-retry-delay retry-count config jitter-ms)

Calculate delay before next retry using exponential backoff.

Args: retry-count - Current retry attempt (0-indexed) config - Retry configuration map with: :backoff-strategy - :linear, :exponential, or :constant :initial-delay-ms - Initial delay (default 1000ms) :max-delay-ms - Maximum delay (default 60000ms) :jitter - Whether jitter is enabled (default true) jitter-ms - Jitter in milliseconds (provided by caller)

Returns: Delay in milliseconds

Calculate delay before next retry using exponential backoff.

Args:
  retry-count - Current retry attempt (0-indexed)
  config - Retry configuration map with:
           :backoff-strategy - :linear, :exponential, or :constant
           :initial-delay-ms - Initial delay (default 1000ms)
           :max-delay-ms - Maximum delay (default 60000ms)
           :jitter - Whether jitter is enabled (default true)
  jitter-ms - Jitter in milliseconds (provided by caller)

Returns:
  Delay in milliseconds
sourceraw docstring

can-retry?clj

(can-retry? job)

Check if job can be retried.

Args: job - Job map

Returns: true if job has retries remaining

Check if job can be retried.

Args:
  job - Job map

Returns:
  true if job has retries remaining
sourceraw docstring

cancel-jobclj

(cancel-job job now)

Mark job as cancelled.

Args: job - Job map now - Current timestamp (provided by caller)

Returns: Updated job with :cancelled status

Mark job as cancelled.

Args:
  job - Job map
  now - Current timestamp (provided by caller)

Returns:
  Updated job with :cancelled status
sourceraw docstring

complete-jobclj

(complete-job job result now)

Mark job as completed successfully.

Args: job - Job map result - Result data from job execution now - Current timestamp (provided by caller)

Returns: Updated job with :completed status

Mark job as completed successfully.

Args:
  job - Job map
  result - Result data from job execution
  now - Current timestamp (provided by caller)

Returns:
  Updated job with :completed status
sourceraw docstring

create-jobclj

(create-job job-input job-id now)

Create a new job from input.

Args: job-input - Map with :job-type, :args, and optional fields job-id - UUID for the job (provided by caller) now - Current timestamp (provided by caller)

Returns: Complete job map with defaults

Create a new job from input.

Args:
  job-input - Map with :job-type, :args, and optional fields
  job-id - UUID for the job (provided by caller)
  now - Current timestamp (provided by caller)

Returns:
  Complete job map with defaults
sourceraw docstring

fail-jobclj

(fail-job job error now)

Mark job as failed.

Args: job - Job map error - Error map with :message, :type, :stacktrace now - Current timestamp (provided by caller)

Returns: Updated job with :failed or :retrying status

Mark job as failed.

Args:
  job - Job map
  error - Error map with :message, :type, :stacktrace
  now - Current timestamp (provided by caller)

Returns:
  Updated job with :failed or :retrying status
sourceraw docstring

filter-executable-jobsclj

(filter-executable-jobs jobs now)

Filter jobs that are ready for execution.

Args: jobs - Collection of jobs now - Current time (Instant)

Returns: Filtered collection of executable jobs

Filter jobs that are ready for execution.

Args:
  jobs - Collection of jobs
  now - Current time (Instant)

Returns:
  Filtered collection of executable jobs
sourceraw docstring

job-summaryclj

(job-summary job)

Create summary of job for monitoring.

Args: job - Job map

Returns: Summary map with key fields

Create summary of job for monitoring.

Args:
  job - Job map

Returns:
  Summary map with key fields
sourceraw docstring

jobs-by-statusclj

(jobs-by-status jobs)

Group jobs by status.

Args: jobs - Collection of jobs

Returns: Map of status -> jobs

Group jobs by status.

Args:
  jobs - Collection of jobs

Returns:
  Map of status -> jobs
sourceraw docstring

prepare-retryclj

(prepare-retry job retry-config now jitter-ms)

Prepare a failed job for retry.

Args: job - Failed job map retry-config - Retry configuration now - Current timestamp (provided by caller) jitter-ms - Jitter in milliseconds (provided by caller)

Returns: Job ready for retry with new execute-at

Prepare a failed job for retry.

Args:
  job - Failed job map
  retry-config - Retry configuration
  now - Current timestamp (provided by caller)
  jitter-ms - Jitter in milliseconds (provided by caller)

Returns:
  Job ready for retry with new execute-at
sourceraw docstring

ready-for-execution?clj

(ready-for-execution? job now)

Check if job is ready to be executed.

Args: job - Job map now - Current time (Instant)

Returns: true if job should be executed now

Check if job is ready to be executed.

Args:
  job - Job map
  now - Current time (Instant)

Returns:
  true if job should be executed now
sourceraw docstring

schedule-jobclj

(schedule-job job-input job-id execute-at now)

Create a scheduled job for future execution.

Args: job-input - Job input map job-id - UUID for the job execute-at - Instant when job should run now - Current timestamp (provided by caller)

Returns: Job map with execute-at set

Create a scheduled job for future execution.

Args:
  job-input - Job input map
  job-id - UUID for the job
  execute-at - Instant when job should run
  now - Current timestamp (provided by caller)

Returns:
  Job map with execute-at set
sourceraw docstring

schedule-retryclj

(schedule-retry job retry-config now jitter-ms)

Calculate when job should be retried.

Args: job - Failed job map retry-config - Retry configuration now - Current timestamp (provided by caller) jitter-ms - Jitter in milliseconds (provided by caller)

Returns: Instant when job should be retried

Calculate when job should be retried.

Args:
  job - Failed job map
  retry-config - Retry configuration
  now - Current timestamp (provided by caller)
  jitter-ms - Jitter in milliseconds (provided by caller)

Returns:
  Instant when job should be retried
sourceraw docstring

sort-by-priorityclj

(sort-by-priority jobs)

Sort jobs by priority (critical > high > normal > low).

Args: jobs - Collection of jobs

Returns: Sorted collection

Sort jobs by priority (critical > high > normal > low).

Args:
  jobs - Collection of jobs

Returns:
  Sorted collection
sourceraw docstring

start-jobclj

(start-job job now)

Mark job as running.

Args: job - Job map now - Current timestamp (provided by caller)

Returns: Updated job with :running status

Mark job as running.

Args:
  job - Job map
  now - Current timestamp (provided by caller)

Returns:
  Updated job with :running status
sourceraw docstring

valid-job-transition?clj

(valid-job-transition? from-status to-status)

Check if status transition is valid.

Args: from-status - Current status to-status - Desired status

Returns: true if transition is allowed

Check if status transition is valid.

Args:
  from-status - Current status
  to-status - Desired status

Returns:
  true if transition is allowed
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close