Class: WhittakerTech::Aeon::ProjectionJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/whittaker_tech/aeon/projection_job.rb

Overview

Enqueue-able wrapper around Projector for asynchronous projection. Accepts serialisation-safe arguments (UUID string + ISO 8601 timestamp) so it can travel through any ActiveJob backend.

Examples:

Enqueue a projection

ProjectionJob.perform_later(allocation.id, 30.days.from_now.iso8601)

Instance Method Summary collapse

Instance Method Details

#perform(allocation_id, horizon_iso8601) ⇒ void

This method returns an undefined value.

Parameters:

  • allocation_id (String)

    UUID of the allocation to project

  • horizon_iso8601 (String)

    ISO 8601 timestamp for the projection horizon (parsed back to +Time+ before delegation)



18
19
20
21
22
23
# File 'app/jobs/whittaker_tech/aeon/projection_job.rb', line 18

def perform(allocation_id, horizon_iso8601)
  Projector.call(
    allocation_id: allocation_id,
    target_until: Time.iso8601(horizon_iso8601)
  )
end