Class: ActiveJob::QueueAdapters::PgbusAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/active_job/queue_adapters/pgbus_adapter.rb

Overview

Adapter for Rails ActiveJob integration with Pgbus.

This class lives in the ActiveJob::QueueAdapters namespace so that Rails can find it via const_get(“PgbusAdapter”) — the standard lookup mechanism used across all Rails versions (7.1+).

Usage:

config.active_job.queue_adapter = :pgbus

Instance Method Summary collapse

Instance Method Details

#enqueue_after_transaction_commit?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/active_job/queue_adapters/pgbus_adapter.rb', line 18

def enqueue_after_transaction_commit?
  true
end

#stopping?Boolean

Called by ActiveJob::Continuation (Rails 8.1+) at each checkpoint. When true, continuable jobs save their cursor and re-enqueue themselves so the worker can shut down gracefully.

Returns:

  • (Boolean)


25
26
27
# File 'lib/active_job/queue_adapters/pgbus_adapter.rb', line 25

def stopping?
  Pgbus.stopping
end