Class: Fopost::Rails::PublishJob

Inherits:
ApplicationJob show all
Defined in:
lib/fopost/rails/publish_job.rb

Overview

Publish an existing post without blocking the request that asked for it.

Fopost::Rails::PublishJob.perform_later(post_id)

Returns once the API has queued delivery, which is not the same as live: subscribe to fopost.post.published for that.

Constant Summary

Constants inherited from ApplicationJob

ApplicationJob::MAX_RETRY_WAIT, ApplicationJob::RETRY_AFTER_KEY

Instance Method Summary collapse

Instance Method Details

#perform(post_id) ⇒ Object



14
15
16
# File 'lib/fopost/rails/publish_job.rb', line 14

def perform(post_id)
  with_retry_after { client.posts.publish(post_id) }
end