sidekiq | Simple , efficient background processing for Ruby | Job Scheduling library

 by   mperham Ruby Version: v7.0.3 License: Non-SPDX

kandi X-RAY | sidekiq Summary

kandi X-RAY | sidekiq Summary

sidekiq is a Ruby library typically used in Data Processing, Job Scheduling, Ruby On Rails applications. sidekiq has no bugs and it has medium support. However sidekiq has 2 vulnerabilities and it has a Non-SPDX License. You can download it from GitHub.

Simple, efficient background processing for Ruby
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sidekiq has a medium active ecosystem.
              It has 12311 star(s) with 2280 fork(s). There are 223 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 20 open issues and 4175 have been closed. On average issues are closed in 30 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of sidekiq is v7.0.3

            kandi-Quality Quality

              sidekiq has 0 bugs and 0 code smells.

            kandi-Security Security

              sidekiq has 2 vulnerability issues reported (0 critical, 1 high, 1 medium, 0 low).
              sidekiq code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sidekiq has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              sidekiq releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              sidekiq saves you 5584 person hours of effort in developing the same functionality from scratch.
              It has 12148 lines of code, 713 functions and 141 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sidekiq and discovered the below as its top functions. This is intended to give you an instant insight into sidekiq implemented functionality, and help decide if they suit your requirements.
            • Parse command line options
            • Processes a workitem .
            • Recursively attempt to retry the exception .
            • Retrieve a list of items from the cache .
            • Fetch stats from redis cache
            • Parses the command line options .
            • Shut down workers .
            • Removes a job with the given name .
            • Dispatch to the given job .
            • Execute a job
            Get all kandi verified functions for this library.

            sidekiq Key Features

            No Key Features are available at this moment for sidekiq.

            sidekiq Examples and Code Snippets

            No Code Snippets are available at this moment for sidekiq.

            Community Discussions

            QUESTION

            Sidekiq's Delayed Extensions will be removed in Sidekiq 7.0
            Asked 2022-Mar-24 at 15:14

            I'm running:

            • ruby 3.1.1
            • Rails 7.0.2.3
            • Sidekiq 6.4.1

            I was upgrading from earlier versions of the bunch and I have this line of code in initializers/sidekiq.rb

            ...

            ANSWER

            Answered 2022-Mar-24 at 03:23

            Starting in Sidekiq version 5, they disabled the delayed extensions by default, with their reasoning documented here. Due to their flexibility, they were prone to misuse.If all you were using the delayed extensions for was to run a job in the future, there are two replacements you can use.

            Sidekiq's way to handle this is called Scheduled Jobs, which looks a bit like SomeSidekiqWorker.perform_in(3.hours, 'argument 1', 'argument 2'), or if you have a specific time you'd like the job to execute, perform_at.

            This functionality is also now built into ActiveJob (Rails guide, API documentation), and looks like SomeJob.set(wait: 3.hours).perform_later('argument 1', 'argument 2').

            The simplest option with a standard rails mailer would be something like these, which use the ActiveJob mechanism under the hood (API Documentation).

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

            QUESTION

            Bitnami Redis Sentinel & Sidekiq on Kubernetes
            Asked 2022-Mar-08 at 20:51

            So right now we are trying to get a Bitnami Redis Sentinel cluster working, together with our Rails app + Sidekiq.

            We tried different things, but it's not really clear to us, how we should specify the sentinels for Sidekiq (crutial part is here, that the sentinel nodes are READ ONLY, so we cannot use them for sidekiq, since job states get written).

            Since on Kubernetes there are only 2 services available: "redis" and "redis-headless" (not sure how they differ?) - how can I specify the sentinels like this:

            ...

            ANSWER

            Answered 2022-Mar-08 at 20:51
            Difference between a Kubernetes Service and a Headless Service

            Let's get started by clarifying the difference between a Headless Service and a Service.

            A Service allows one to connect to one Pod, while a headless Service returns the list of available IP addresses from all the available pods, allowing to auto-discover.

            A better detailed explanation by Marco Luksa has been published on SO here:

            Each connection to the service is forwarded to one randomly selected backing pod. But what if the client needs to connect to all of those pods? What if the backing pods themselves need to each connect to all the other backing pods. Connecting through the service clearly isn’t the way to do this. What is?

            For a client to connect to all pods, it needs to figure out the the IP of each individual pod. One option is to have the client call the Kubernetes API server and get the list of pods and their IP addresses through an API call, but because you should always strive to keep your apps Kubernetes-agnostic, using the API server isn’t ideal

            Luckily, Kubernetes allows clients to discover pod IPs through DNS lookups. Usually, when you perform a DNS lookup for a service, the DNS server returns a single IP — the service’s cluster IP. But if you tell Kubernetes you don’t need a cluster IP for your service (you do this by setting the clusterIP field to None in the service specification ), the DNS server will return the pod IPs instead of the single service IP. Instead of returning a single DNS A record, the DNS server will return multiple A records for the service, each pointing to the IP of an individual pod backing the service at that moment. Clients can therefore do a simple DNS A record lookup and get the IPs of all the pods that are part of the service. The client can then use that information to connect to one, many, or all of them.

            Setting the clusterIP field in a service spec to None makes the service headless, as Kubernetes won’t assign it a cluster IP through which clients could connect to the pods backing it.

            "Kubernetes in Action" by Marco Luksa

            How to specify the sentinels

            As the Redis documentation say:

            When using the Sentinel support you need to specify a list of sentinels to connect to. The list does not need to enumerate all your Sentinel instances, but a few so that if one is down the client will try the next one. The client is able to remember the last Sentinel that was able to reply correctly and will use it for the next requests.

            So the idea is to give what you have, and if you scale up the redis pods, then you don't need to re-configure Sidekiq (or Rails if you're using Redis for caching).

            Combining all together

            Now you just need a way to fetch the IP addresses from the headless service in Ruby, and configure Redis client sentinels.

            Fortunately, since Ruby 2.5.0, the Resolv class is available and can do that for you.

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

            QUESTION

            Is this a bug in ruby Regexp? How to guard against "infinite loop" from regex match without using Timeout?
            Asked 2022-Feb-21 at 17:07

            I have this regex:

            ...

            ANSWER

            Answered 2022-Feb-21 at 17:07

            Built-in character classes are more table-driven.
            Given that, Negative built-in ones like \W, \S etc...
            are difficult for engines to merge into a positive character class.

            In this case, there are some obvious bugs because as you've said, it doesn't time out on
            some target strings.

            In fact, [a-xzA-XZ\W] works given the sample string. It times out when Y is included anywhere
            but just for that particular string.

            Let's see if we can determine if this is a bug or not.

            First, some tests:

            Test - Fail [a-zA-Z\W]

            https://rextester.com/FHUQG84843

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

            QUESTION

            Redis gem 4.6.0: Multi pipeline commands warnings in sidekiq logs
            Asked 2022-Feb-07 at 21:49

            I'm using sidekiq to run background jobs in ROR application. Recently redis gem version got updated to 4.6.0 (automatically as sidekiq dependency), but its producing some multi pipeline commands warning continuously as sidekiq logs flooded with these logs and its difficult to track Worker logs. Please let me know how can i remove these warnings?

            Sidekiq logs:

            ...

            ANSWER

            Answered 2022-Feb-04 at 18:56

            Here is the reason for that:

            That’s from the Redis gem. 6.4.1 will be released Monday and fix it. Downgrade that gem or use Sidekiq’s main branch if you want an immediate fix.

            https://github.com/mperham/sidekiq/issues/5178#issuecomment-1029545859

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

            QUESTION

            Sidekiq jobs are getting Enqueued but it's not getting processed. All Jobs are stuck in Enqueued
            Asked 2022-Jan-31 at 04:54

            I am trying to send email using sidekiq but it's not working. Here is how i setup sidekiq with ActiveJob

            Gemfile

            ...

            ANSWER

            Answered 2022-Jan-13 at 15:53

            You need to tell sidekiq which queues to process. By default, some frameworks have their own queue names.

            Create a sidekiq configuration file (e. g. config/sidekiq.yml) and define the queues that it should use

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

            QUESTION

            How to use Sorcery Gem with Sidekiq
            Asked 2022-Jan-17 at 14:15

            I am using Sorcery Gem to Authenticate user in my Rails application. Everything is working fine. When user register then I am able to send user activation email. However sending email is taking long time so I was thinking to delay the email or send email in backgroud using Sidekiq. I read Sorcery documentation but couldn't find the way to delay the email using Sidekiq.

            Please guide me how to delay the email send by Sorcery gem using Sidekiq.

            ...

            ANSWER

            Answered 2022-Jan-12 at 14:48

            There could be two approach to this:

            1. Call Sidekiq worker inside Mailer

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

            QUESTION

            How can I ensure Sidekiq background jobs run against the same database they were initiated from
            Asked 2021-Dec-20 at 21:17

            I have been implementing horizontal database sharding in Rails 6.1 using the new native multiple database connection switching. This has worked great in general, but I am trying to find the best way ensure that background jobs (via Sidekiq backed by a shared Redis DB) are run against the same database shard that they were initiated from.

            e.g I have two horizontal database shards, Database A and Database B. The job is enqueued from a web process while connected to database A (using a Rack middleware). When that job is run later in the Sidekiq process, I would like the job to be automatically run against Database A.

            A brute-force way to do this would be to pass the current connected database as an argument into every job, and then, in each job, connect to the database specified in the argument using the functionality at https://guides.rubyonrails.org/active_record_multiple_databases.html.

            If I was using an older solution to horizontal sharding like Apartment, the https://github.com/influitive/apartment-sidekiq gem would be exactly what I needed. However I cannot find any solutions on how to do something similar with Rails's new native functionality.

            What is the best way to accomplish this?

            ...

            ANSWER

            Answered 2021-Dec-20 at 21:17

            You want to save the current shard using a client middleware and restore it in a server middleware. See the notes about ActiveSupport::CurrentAttributes and the Middleware wiki page.

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

            QUESTION

            How to query Sidekiq queues by Job class, queue name and arguments?
            Asked 2021-Oct-19 at 21:08

            I have to check if the same job has already been added to the queue before enqueue again.

            Currently I use this code but it's very inefficient because it loads all object into memory. Is there a way to query like a normal active record?

            Ideally, I would something like

            ...

            ANSWER

            Answered 2021-Oct-18 at 15:42

            There is no out-of-the-box solution, but there is a simpler way to determine if a job's been already queued (true/false):

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

            QUESTION

            Docker-compose with redis, sidekiq, rails SocketError
            Asked 2021-Oct-14 at 10:16

            I am perplexed about the error in my docker-compose config. I am adding redis alongside sidekiq to the existing rails app that uses docker-compose but I am failing hard on attempts to make the containers communicate with each other. I have tried several different options and looked at pretty much every reasonable topic on SO that touches this subject but I keep failing on basically the same thing. Here is my current config (or at least the relevant parts of it) and error:

            docker-compose.yml ...

            ANSWER

            Answered 2021-Oct-13 at 20:17

            You are probably not exposing redis port to the sidekiq service try exposing this in docker compose. This probably may work.

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

            QUESTION

            Sidekiq - Errno::EALREADY: Operation already in progress
            Asked 2021-Oct-05 at 08:27

            I have an issue with a Sidekiq (6.2.1) and Redis (4.4.0) running with docker-compose. I found nothing useful on internet, Redis is up and running, it also seems that Sidekiq can connect but then, Sidekiq exits at start because of some kind of concurrency:

            ...

            ANSWER

            Answered 2021-Oct-05 at 08:27

            After rebooting my computer, it now works...

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install sidekiq

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            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/mperham/sidekiq.git

          • CLI

            gh repo clone mperham/sidekiq

          • sshUrl

            git@github.com:mperham/sidekiq.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

            Consider Popular Job Scheduling Libraries

            Try Top Libraries by mperham

            inspeqtor

            by mperhamGo

            connection_pool

            by mperhamRuby

            girl_friday

            by mperhamRuby

            rack-fiber_pool

            by mperhamRuby

            bayes_motel

            by mperhamRuby