Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7175391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:16:57+00:00 2026-05-28T16:16:57+00:00

I am giving resque a try, but not sure about resque worker instance’s lifecyle.

  • 0

I am giving resque a try, but not sure about resque worker instance’s lifecyle. Lets say I have the task set up the following way:

class User

  def self.start_job(str)
    Resque.enqueue(Job, str)
  end

end

and

class Job

  def self.perform(str)
    Message.create(:user => str.split(" ")[0], 
                   :message => str.split(" ")[1])
  end

end

After the Message is created, there is after_create hook which calls another long running task:

class Message < ActiveRecord::Base

  after_create (or after_commit) :do_a_ridiculous_long_task

  def do_a_ridiculous_long_task
    do_something
  end

end

Does resque worker’s lifecycle end right after the message is created, or does it continue until after after_create method in Message model is finished? In other terms, how far does resque worker trail along with the ActiveRecord object’s lifecycle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:17:00+00:00Added an answer on May 28, 2026 at 4:17 pm

    Turns out that resque worker is not responsible for after_create events it will trigger. Those events will be passed on to rails instance.

    Here is the answer: https://github.com/defunkt/resque/issues/483#issuecomment-3396215

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am giving Vim xdebug plugin a try, but when I put cursor on
The example I am giving is not exactly what I'm working on, but its
I am giving the if else statements a stab, not sure if I am
I'm giving my first steps on Python. I saw that we don't have switch
We are giving a demo in a couple days and I have to go
Very simple question but giving me hard time, I want to replace to \
My intellisense is giving me the error: 'ClassLibrary1.GetTimeZone.myWorldTime' is a 'field' but is used
I am try to have a forum submits more then once when a user
Giving a little background info: Details.cshtml contains a title (uses model Category), I have
I'm giving a try to PascalScript, due to its features which could be very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.