Questions tagged [sucker-punch]

Sucker Punch is a Ruby asynchronous processing library using Celluloid, heavily influenced by Sidekiq and girl_friday.

Definition:

Sucker Punch is a single-process Ruby asynchronous processing library which uses concurrent-ruby.

Installation Instructions:

gem install sucker_punch

Example Usage:

class ExampleJob
    include SuckerPunch::Job
    def perform(data)
        puts data
    end
end

ExampleJob.perform_async("qwerty")  # perform immediately and asynchronously
ExampleJob.perform_in(30, "qwerty") # perform will be executed 30 seconds later

Important Links:

31 questions
4
votes
2 answers

undefined method `async' (suckerpunch gem)

I am using sucker_punch gem to send the email in my rails app in the background.It used to work fine, but then I suddenly got this error: undefined method `async' for…
Ryzal Yusoff
  • 957
  • 2
  • 22
  • 49
3
votes
0 answers

How to remove a future job with sucker_punch

I'm using sucker punch future job but sometimes I need to remove it in another request before it is executed. For that I have to find it by the args I passed to the job before being able to kill it.
AlexLarra
  • 841
  • 5
  • 18
3
votes
2 answers

Wait for SuckerPunch::Job task completion

I try the Sucker Punch gem to process tasks in parallel. But I found no documentation how to wait for its termination. require 'sucker_punch' class SuckerJob include SuckerPunch::Job workers 4 def perform(event) sleep(rand(5)) puts…
sschmeck
  • 7,233
  • 4
  • 40
  • 67
3
votes
2 answers

Using Sucker Punch with Active Job, Is there a way to cancel a queued job?

So I have MyJob.perform_in(60, @user), Which will perform my job in 60 seconds. I want to cancel this Job if this line of code is ran again replacing it in the queue. I have had no luck researching.
Gil F.
  • 31
  • 5
3
votes
0 answers

Sucker punch tests in rails, using connection_pool block, results in connection timeout

Thanks in advance for your kind response. At work we are using sucker punch gem for a rails app to send emails and other stuff we want to do asynchronously. We implemented a couple of actors with no problems and even wrote some tests for them…
Aldana
  • 383
  • 1
  • 9
3
votes
1 answer

Sucker Punch Job being killed by Passenger? or Deadlock?

Wondering if anyone has seen this problem. I am running Rails 3.2 on Passenger 3 with sucker_punch gem version 1.1 I have a long running sucker_punch job ( takes around 10 hours) it's an overnight batch. I am running on Phusion Passenger with (I…
dboyd68
  • 1,104
  • 15
  • 33
2
votes
0 answers

Net::OpenTimeout execution expired in Action Mailer Ruby on Rails 5

I am getting the below error while sending emails from ActionMailer ERROR -- : [ActiveJob] [ActionMailer::DeliveryJob] [a532d442-ad8a-44a9-b13d-a2a3ec9c5bd9] Error performing ActionMailer::DeliveryJob (Job ID: …
Chakreshwar Sharma
  • 2,571
  • 1
  • 11
  • 35
2
votes
2 answers

Is there a way to list Sucker Punch jobs on queue from rails console?

In DelayedJob we can use Delayed::Job.all on console to list all jobs on queue. Is there a way to do the same using SuckerPunch gem?
2
votes
0 answers

ActiveJob queue adapter ignored?

user_controller.rb class UsersController def create MyJob.perform_later User.create(...) end end my_job.rb class MyJob < ActiveJob::Base queue_as :default def perform() puts "START" sleep 3 puts "END" …
2
votes
2 answers

How does a rails asynchronous job let the controller know it's done?

I'm using the newest version of rails and ruby. Through a form I import a CSV which then triggers an async job (I'm using the gem https://github.com/brandonhilkert/sucker_punch for this) that reads the file and handles the data. All in all…
NickEckhart
  • 458
  • 2
  • 8
  • 21
2
votes
1 answer

How long can a sucker_punch worker run for on heroku?

I have sucker_punch worker which is processing a csv file, I initially had a problem with the csv file disappearing when the dyno powered down, to fix that i'm gonna set up s3 for file storage. But my current concern is whether a dyno powering down…
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84
1
vote
0 answers

How to pass view_context to ActiveJob background worker?

I am trying to pass the view_context object to a background worker: invoices = current_user.invoices ArchiveInvoicesJob.perform_later(invoices.pluck(:id), view_context) I understand that I cannot pass ActiveRecord:Relations to ActiveJob. That's why…
Tintin81
  • 9,821
  • 20
  • 85
  • 178
1
vote
1 answer

Rails ActiveJob Background Job Keeps Pinging Mailchimp Repeatedly

I have a rails app (v4.2) I'm developing and when a user registers for the site, I'd like to sign them up to my Mailchimp mailing list. I've implemented this process as a background job with sucker_punch and the gibbon gem. Read more here (Rails…
1
vote
1 answer

Rails and sucker_punch: Debounce x seconds before executing job to control rate of execution

In my Rails 3.2 project, I am using SuckerPunch to run a expensive background task when a model is created/updated. Users can do different types of interactions on this model. Most of the times these updates are pretty well spaced out, however for…
Shaunak
  • 17,377
  • 5
  • 53
  • 84
1
vote
0 answers

Rails ActiveJob not using correct adapter when specified in a custom initialiser

I'm attempting to get ActiveJob to use the sucker-punch adapter with the below code in config/initilizers/sucker_punch.rb Rails.application.configure do config.active_job.queue_adapter = :sucker_punch end With this code in place ActiveJob still…
morriphi
  • 21
  • 2
1
2 3