resque | backed Ruby library for creating background jobs | Job Scheduling library

 by   resque Ruby Version: v2.5.0 License: MIT

kandi X-RAY | resque Summary

kandi X-RAY | resque Summary

resque is a Ruby library typically used in Data Processing, Job Scheduling applications. resque has a Permissive License and it has medium support. However resque has 59 bugs and it has 1 vulnerabilities. You can download it from GitHub.

For the backstory, philosophy, and history of Resque’s beginnings, please see [the blog post] Resque allows you to create jobs and place them on a queue, then, later, pull those jobs off the queue and process them.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              resque has a medium active ecosystem.
              It has 9305 star(s) with 1674 fork(s). There are 259 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 58 open issues and 827 have been closed. On average issues are closed in 175 days. There are 12 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of resque is v2.5.0

            kandi-Quality Quality

              resque has 59 bugs (0 blocker, 0 critical, 41 major, 18 minor) and 58 code smells.

            kandi-Security Security

              resque has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              OutlinedDot
              resque code analysis shows 1 unresolved vulnerabilities (1 blocker, 0 critical, 0 major, 0 minor).
              There are 0 security hotspots that need review.

            kandi-License License

              resque is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              resque releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              resque saves you 2748 person hours of effort in developing the same functionality from scratch.
              It has 5951 lines of code, 514 functions and 67 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed resque and discovered the below as its top functions. This is intended to give you an instant insight into resque implemented functionality, and help decide if they suit your requirements.
            • Executes the given block .
            • Prune any of dead workers that have expired .
            • Unregisters a worker .
            • Performs a child process .
            • Waits for the child process .
            • Start the worker thread
            • Waits for a single job
            • Kills the child process .
            • Reconnect to Redis .
            • Attempt to find a job by name .
            Get all kandi verified functions for this library.

            resque Key Features

            No Key Features are available at this moment for resque.

            resque Examples and Code Snippets

            No Code Snippets are available at this moment for resque.

            Community Discussions

            QUESTION

            Bundler couldn't find compatable versions on bundle install in rails
            Asked 2021-Apr-11 at 04:57

            I have cloned an existing project and trying to run it in my system. Since this is the first time I don't have any Gemfile.lock file in my directory. I tried running bundle install and the following errors occur:

            ...

            ANSWER

            Answered 2021-Apr-10 at 18:06

            In your project directory, try installing rails gem install rails -v 4.1.6 and removing the version from the failing gems like (liquid_markdown, gon, etc..) then try running bundle update then bundle clean --force

            I think this might be an issue because all the version of these gems are locked inside your Gemfile

            Source https://stackoverflow.com/questions/67036420

            QUESTION

            Sprockets::Rails::Helper::AssetNotPrecompiled in ResqueWeb
            Asked 2021-Mar-20 at 07:29

            I've been trying to fix this for about two days but I'm getting no where. I'm trying to get the resque-web page to show but I keep running into the error

            Sprockets::Rails::Helper::AssetNotPrecompiled in ResqueWeb::Overview#show

            Message shown

            ...

            ANSWER

            Answered 2021-Mar-20 at 07:29

            resque comes with a built-in server. You do not need resque-web and it seems it is not maintained (last commit was on 2018).

            Let's try this:

            Source https://stackoverflow.com/questions/66715972

            QUESTION

            Rails 6 Active Job. Why I can't send async tasks?
            Asked 2021-Mar-16 at 20:38

            I was following the Action Mailer guideon https://guides.rubyonrails.org/action_mailer_basics.html#calling-the-mailer

            I did almost the same of what tutorial show. The controller:

            ...

            ANSWER

            Answered 2021-Mar-16 at 20:38

            It's not working because ActiveJob doesn't support the objects. To make it accessible you have to either convert it into json string and then deserialise in the mailer method.

            Try sending the object as json string and retrieve the id value, then use:

            Source https://stackoverflow.com/questions/66662682

            QUESTION

            Best practice to implement scheduled task execution with Rails?
            Asked 2021-Feb-23 at 18:48

            In my Rails application users can cancel their subscription which should trigger a function that downgrades their account at their current_billing_period_end (this variable is provided by the API of the payment provider). For example a user cancels their subscription on the 12th of April but has a valid subscription until the 1st of March. So the premium entry in the database for this user should be set to false only on the 1st of March.

            I have implemented a working solution with Resque and Resque-Scheduler but am now wondering if that might be a bit overkill?

            I could instead set a subscription_end_date database entry for the user when the subscription is canceld and set it to current_billing_period_end and then whenever the user authenticates I'd run

            ...

            ANSWER

            Answered 2021-Feb-23 at 18:48

            Don't do that.

            It's a bad design to schedule many jobs for a few days or weeks later, especially when they perform a critical task.

            Why?

            Mainly because the scheduled job's date is not stored in your application database but another one, most of the time in Redis. In the majority of cases, it is not included in the backup. So the day you need to restore a backup, you'll lose all pending scheduled job. All the accounts that were pending for the last subscription period to end may remain open.

            The safest solution is to rely on a database field holding the actual end of the subscription date. Let's name it subscription_ends_on. If your user unsubscribes on April 12th, you set subscription_ends_on with the value "March 1rst".

            Then you create a background job that runs every day at midnight and unsubscribe all accounts where subscription_ends_on is not null and is less than or equal to today.

            Source https://stackoverflow.com/questions/66336031

            QUESTION

            Rails Heroku Deployment Error: Precompiling assets failed – Sprockets::FileNotFound: couldn't find file 'angular' with type 'application/javascript'
            Asked 2021-Feb-19 at 13:59

            My app works locally, however when I try to deploy to Heroku, I get a Sprockets::FileNotFound: couldn't find file 'angular' with type 'application/javascript' error.

            I have tried precompiling with RAILS_ENV=production bundle exec rake assets:precompile and purging my build cache with heroku builds:cache:purge -a findum, but still no luck. I recently migrated from Bower to Yarn– not sure if my asset path is the problem?

            Has anyone run into a similar error that they were able to resolve? So many thanks 🙏.

            This is my application.js :

            ...

            ANSWER

            Answered 2021-Feb-19 at 13:57

            Update:

            It looks like it was a problem with my post-Bower configuration (I migrated from Bower --> Yarn) I was able to solve Sprockets errors by adding this line to my assets.rb:

            Rails.application.config.assets.paths << Rails.root.join('node_modules')

            and by running yarn add for files that Sprockets could not locate.

            I also made the following updates to old package names in my `application.rb'

            Source https://stackoverflow.com/questions/66157141

            QUESTION

            resque-status is not compatible with my current resque version
            Asked 2020-Dec-12 at 22:50

            I added a new gem to my Gemfile unrelated to the resque gem and I've having issues with bundle install. I do not want to run bundle update because I don't wan't to make unnecessary changes within the Gemfile.lock. What is the best way to get past this error without making too many changes? I want to keep my resque versions consistent with previous versions.

            ...

            ANSWER

            Answered 2020-Dec-12 at 22:50

            The problem with resque-status: its last commit (to date, for 0.5.0 version) was done 5 years ago, so is a pretty outdated and unmaintained gem.
            As long as this isn't updated, you should try luck with some of the forks. This looks promising, as it update the version restrictions in the gemspec, so try adding to your Gemfile:

            Source https://stackoverflow.com/questions/65240653

            QUESTION

            Resque not failing an obviously buggy job
            Asked 2020-Dec-11 at 12:01

            I have the following problem with Resque and Rails 6 (ruby 2.7.2). I am new to this gem and wanted to do some simple testing to see how things are handled, so I created a simple failing job:

            ...

            ANSWER

            Answered 2020-Dec-11 at 12:01

            I don't know why, but this is the solution. Rather than running:

            Source https://stackoverflow.com/questions/65224796

            QUESTION

            How to prioritize queues using Resque and Redis
            Asked 2020-Oct-23 at 16:38

            My application has multiple queues and I'm trying to prioritize specific queues.

            resque-pool.yml

            ...

            ANSWER

            Answered 2020-Oct-23 at 16:38

            You have it right. As the main Resque documentation states:

            Resque doesn't support numeric priorities but instead uses the order of queues you give it. We call this list of queues the "queue list."

            Let's say we add a warm_cache queue in addition to our file_serve queue. We'd now start a worker like so:

            $ QUEUES=file_serve,warm_cache rake resque:work

            When the worker looks for new jobs, it will first check file_serve. If it finds a job, it'll process it then check file_serve again. It will keep checking file_serve until no more jobs are available. At that point, it will check warm_cache. If it finds a job it'll process it then check file_serve (repeating the whole process).

            In this way you can prioritize certain queues.

            Note that, in a resque-pool setup, each process that spawns will follow its own priority (so in the example config it's possible bar jobs will get processed before foo jobs if the process that only processes bar is free while the others are busy). That's a feature, though, not a bug!

            As for how you can test it, simply enqueue a bunch of jobs in each queue and watch as they get processed in resque-web (or the logs).

            Source https://stackoverflow.com/questions/64503667

            QUESTION

            Rails 6 Auto delete posts from database every 24 hours
            Asked 2020-Aug-15 at 20:44

            is there a way to automatically delete posts/products/articles or anything created on a rails 6 app? I'm trying to build an online image repository that users can upload images that appear only for 24 hours and then get deleted.I have the posting and saving of the pictures/text through active storage and Postgres but i can't get it to get deleted automatically. I've read about whenever sidekiq and resque scheduler but i find it difficult to understand and make it work. i tried from some tutorials and reading the documentation but I'm still having trouble. Can anyone point me in the right direction or try to help me?

            ...

            ANSWER

            Answered 2020-Aug-15 at 20:44

            You have many options

            1. The simplest one is creating a rake task and setting up a cron job to call this time every minute or something like that. If you call it every 24h you may end up with posts staying for up to 47h.

            2. You can use delayed jobs in two ways

              2.1 In an after_create callback, set a job to delete the post after 24 hours. Something like this handle_asynchronously :in_the_future, run_at: Proc.new { 24.hours.from_now }

              2.2 Using delayed_job_recurring gem to do the same thing in option one, but without the need of using cron

            Edit: I would use option 2.1 since it's the simplest one and easier to maintain, the only downside is that it will create a job for every post, but that shouldn't be a problem even with a million posts a day

            Source https://stackoverflow.com/questions/63430579

            QUESTION

            Can someone explain the term QUEUE=* rake resque:work
            Asked 2020-Jul-29 at 09:18

            On Ruby on Rails I need to start a 'rescue' task. To let this work the command QUEUE=* rake resque:work must be executed in a new terminal (macOS).

            But: Can someone explain what this actually means?

            ...

            ANSWER

            Answered 2020-Jul-29 at 09:18

            resque worker will keep on polls redis queues for pending jobs. So, we need to pass queue names as args to resque task while starting the task. QUEUE=* is doing the same here.

            So, here your question can be breakdown to 2 parts,

            1. what is the purpose of QUEUE
            2. What is the purpose of *

            QUEUE:

            In ruby we can do this in 4 ways.

            1. Rake args:

              rake resque:work[*]

              For this to work resque task should have the following convention

            Source https://stackoverflow.com/questions/63146924

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install resque

            Add the gem to your Gemfile:.

            Support

            Please add them to the [FAQ](https://github.com/resque/resque/wiki/FAQ) or open an issue on this repo.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/resque/resque.git

          • CLI

            gh repo clone resque/resque

          • sshUrl

            git@github.com:resque/resque.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Reuse Pre-built Kits with resque

            Consider Popular Job Scheduling Libraries

            Try Top Libraries by resque

            resque-scheduler

            by resqueRuby

            redis-namespace

            by resqueRuby

            resque-pool

            by resqueRuby

            php-resque

            by resquePHP

            resque-loner

            by resqueRuby