Optional integration with boundary-jobs for async report generation.
This namespace provides async report generation via the jobs module. The jobs module is an OPTIONAL dependency — add it to your deps.edn:
{:deps {org.boundary-app/boundary-jobs {:mvn/version "0.1.0"}}}
If the jobs module is not available, async functions will throw descriptive errors with :type :missing-dependency.
Usage: ;; Queue report for async generation (queue-report-job! report-def {:invoice-id 42})
;; Register report job handler with jobs module (register-report-job-handler! job-registry)
The job handler will:
Optional integration with boundary-jobs for async report generation.
This namespace provides async report generation via the jobs module.
The jobs module is an OPTIONAL dependency — add it to your deps.edn:
{:deps {org.boundary-app/boundary-jobs {:mvn/version "0.1.0"}}}
If the jobs module is not available, async functions will throw descriptive
errors with :type :missing-dependency.
Usage:
;; Queue report for async generation
(queue-report-job! report-def {:invoice-id 42})
;; Register report job handler with jobs module
(register-report-job-handler! job-registry)
The job handler will:
- Resolve data via :data-source (if defined)
- Generate the report bytes
- Optionally store via boundary-storage (:storage-key in opts)
- Optionally send an email notification (:notify-email in opts)(process-report-job job-args)Job handler for generating reports.
Called by the jobs module worker pool. Generates the report, optionally stores via boundary-storage, and optionally sends an email notification.
Job args structure: :report-def - ReportDefinition map :opts - Options map (may include :notify-email, :storage-key)
Returns: {:success? true :result {:report-id :k :filename "f.pdf" :bytes N}} {:success? false :error {:message "..." :type "ReportJobError"}}
Job handler for generating reports.
Called by the jobs module worker pool. Generates the report, optionally
stores via boundary-storage, and optionally sends an email notification.
Job args structure:
:report-def - ReportDefinition map
:opts - Options map (may include :notify-email, :storage-key)
Returns:
{:success? true :result {:report-id :k :filename "f.pdf" :bytes N}}
{:success? false :error {:message "..." :type "ReportJobError"}}(queue-report-job! report-def opts)Queue a report for async generation via boundary-jobs.
Args: report-def - ReportDefinition map (from defreport or plain map) opts - Options forwarded to the job handler: :notify-email - Email address for completion notification :storage-key - Object key for boundary-storage output + any other opts passed to generate
Returns job-id (UUID string).
Throws ex-info with :type :missing-dependency if boundary-jobs is unavailable.
Queue a report for async generation via boundary-jobs.
Args:
report-def - ReportDefinition map (from defreport or plain map)
opts - Options forwarded to the job handler:
:notify-email - Email address for completion notification
:storage-key - Object key for boundary-storage output
+ any other opts passed to generate
Returns job-id (UUID string).
Throws ex-info with :type :missing-dependency if boundary-jobs is unavailable.(register-report-job-handler! job-registry)Register the :generate-report job handler with boundary-jobs.
After registration, jobs with :job-type :generate-report will be processed by process-report-job.
Args: job-registry - IJobRegistry instance from boundary-jobs
Returns :generate-report (the job-type keyword).
Throws ex-info with :type :missing-dependency if boundary-jobs is unavailable.
Register the :generate-report job handler with boundary-jobs. After registration, jobs with :job-type :generate-report will be processed by process-report-job. Args: job-registry - IJobRegistry instance from boundary-jobs Returns :generate-report (the job-type keyword). Throws ex-info with :type :missing-dependency if boundary-jobs is unavailable.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |