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
1
vote
1 answer

Sucker punch running background jobs ActiveRecord Error - Rails app

I'm trying to run a background mailer and depending on the params of the article, dump different users into the mailing list. I'm getting this error upon request to make a new article: Actor crashed! NoMethodError: undefined method `email' for…
jpn
  • 285
  • 2
  • 15
1
vote
1 answer

flash error from delayed job in rails

In my rails app, I'm running delayed jobs with Sucker Punch gem. I'm looping through some phone numbers sending an sms message to each with Twilio. If there is an error with Twilio sending it, I can capture it with a rescue just fine, but is there a…
Scott
  • 172
  • 1
  • 6
1
vote
1 answer

Why will this test not run with sucker punch gem?

The purpose of this code is to send an email to a user with an array of products whose discount percentages have reached a given threshold. The products are returned by: user.notifications which returns an array of 2 element arrays with the…
ruby_newbie
  • 3,190
  • 3
  • 18
  • 29
1
vote
1 answer

Ensure only one job runs on rails SuckerPunch/Celluloid

I have a simple SuckerPunch job, I am trying to make it so only one job runs at any given time. Struggling to work it out tried playing with Celluloid and Ruby concurrency What I have DataChangeJob.new.async.perform with class DataChangeJob …
dboyd68
  • 1,104
  • 15
  • 33
0
votes
0 answers

Sucker Punch cannot connect to mysql

I have old rails application where is Sucker Punch used for logging user actions. In logs I see plenty of these errors ERROR -- : Sucker Punch job error for class: 'LoggerJob' args: []...Mysql2::Error MySQL client is not connected As I dont see…
Mi Ro
  • 740
  • 1
  • 6
  • 31
0
votes
1 answer

how to debug crashed SuckerPunch job in production

iam trying to run an async job with SuckerPunch, which posts some data to a REST API, and writes the response into a database. On the rails CLI and the dev environment it is working. In production, it is crashing, when the API responds with an…
Bastian
  • 177
  • 2
  • 12
0
votes
0 answers

Page freezes when running process in background with suckerpunch

i try to start a process in the background which executes some code. When i start the process, my app freezes until the background task is done. Iam using SuckerPunch to work around exactly this freezing, however the app still waits for the process…
Bastian
  • 177
  • 2
  • 12
0
votes
0 answers

Connection Timeout Error

I am getting following error on my application logs ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds) My application is required to create too many background workers. I am…
Bloomberg
  • 2,317
  • 2
  • 25
  • 47
0
votes
1 answer

How to pass locale to ActiveJob / SuckerPunch when sending delayed email?

In my Rails 5 app I am trying to send emails with ActiveJob and Sucker Punch: # app/controllers/users_controller.rb class UsersController < ApplicationController def activate user = User.find_by(:activation_token => params[:id]) …
Tintin81
  • 9,821
  • 20
  • 85
  • 178
0
votes
0 answers

Rails sucker punch - Is there a way to handle errors by retrying the action performed

In my application I am sending emails asynchronously with sucker punch gem. Sometimes the mail server is very unresponsive and I get Net::ReadTimeout exceptions. I am wondering if there is better way of handling errors than doing something like…
basiszwo
  • 575
  • 3
  • 8
0
votes
0 answers

Rails Mailchimp Background Job Not Implemented Error

So I'd like to add a user that registers on my rails site onto a mailing list. I've got the gibbon gem installed and I had success testing my ruby method in a stand-alone ruby file. I'm having issues integrating it into my application, however. …
JohnOHFS
  • 174
  • 14
0
votes
1 answer

Rails Sucker Punch - How to start jobs without visiting homepage?

I'm trying to figure out how to have my background jobs in SuckerPunch start work without having to load the index page. Right now, what I do is: $ rails server #starts the server at localhost:3000 Then I go to my browser URL and enter…
mhz
  • 1,019
  • 2
  • 8
  • 30
0
votes
1 answer

Sucker_punch errors or not properly running background jobs

I have a Classified Model where i use a after_create callback for checking keywords of a user and send email notification. this email it is send by a Background Job using ActiveJobs and Sucker_punch as background driver. I see in the logs 3 jobs…
JAM
  • 761
  • 1
  • 5
  • 14
0
votes
1 answer

Undefined route error (Rails)

I'm seeing the following error: Error message: undefined local variable or method `call_alert_path' for # However, I feel like call_alert_path is properly defined in the routes. This is corroborated by the…
james
  • 3,989
  • 8
  • 47
  • 102
0
votes
1 answer

Quick explanation of recurrence rules via ice_cube for fist of fury/ sucker punch

This is probably not the brightest question... feeling especially dense about this. I'm using a really nifty gem, Fist of Fury, to do recurring background tasks with Sucker Punch: https://github.com/facto/fist_of_fury. As the author of the gem…
james
  • 3,989
  • 8
  • 47
  • 102