openaustralia/planningalerts

View on GitHub
sorbet/rbi/gems/sidekiq@6.5.12.rbi

Summary

Maintainability
Test Coverage
# typed: true

# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `sidekiq` gem.
# Please instead update this file by running `bin/tapioca gem sidekiq`.

# Use `Sidekiq.transactional_push!` in your sidekiq.rb initializer
#
# source://sidekiq//lib/sidekiq/version.rb#3
module Sidekiq
  class << self
    # source://sidekiq//lib/sidekiq.rb#106
    def [](key); end

    # source://sidekiq//lib/sidekiq.rb#110
    def []=(key, val); end

    # How frequently Redis should be checked by a random Sidekiq process for
    # scheduled and retriable jobs. Each individual process will take turns by
    # waiting some multiple of this value.
    #
    # See sidekiq/scheduled.rb for an in-depth explanation of this value
    #
    # source://sidekiq//lib/sidekiq.rb#303
    def average_scheduled_poll_interval=(interval); end

    # @yield [@client_chain]
    #
    # source://sidekiq//lib/sidekiq.rb#209
    def client_middleware; end

    # config.concurrency = 5
    #
    # source://sidekiq//lib/sidekiq.rb#60
    def concurrency=(val); end

    # Configuration for Sidekiq client, use like:
    #
    #   Sidekiq.configure_client do |config|
    #     config.redis = { size: 1, url: 'redis://myhost:8877/0' }
    #   end
    #
    # @yield [_self]
    # @yieldparam _self [Sidekiq] the object that the method was called on
    #
    # source://sidekiq//lib/sidekiq.rb#151
    def configure_client; end

    # Configuration for Sidekiq server, use like:
    #
    #   Sidekiq.configure_server do |config|
    #     config.server_middleware do |chain|
    #       chain.add MyServerHook
    #     end
    #   end
    #
    # @yield [_self]
    # @yieldparam _self [Sidekiq] the object that the method was called on
    #
    # source://sidekiq//lib/sidekiq.rb#141
    def configure_server; end

    # Death handlers are called when all retries for a job have been exhausted and
    # the job dies.  It's the notification to your application
    # that this job will not succeed without manual intervention.
    #
    # Sidekiq.configure_server do |config|
    #   config.death_handlers << ->(job, ex) do
    #   end
    # end
    #
    # source://sidekiq//lib/sidekiq.rb#250
    def death_handlers; end

    # Private APIs
    #
    # source://sidekiq//lib/sidekiq.rb#84
    def default_error_handler(ex, ctx); end

    # source://sidekiq//lib/sidekiq.rb#237
    def default_job_options; end

    # source://sidekiq//lib/sidekiq.rb#229
    def default_job_options=(hash); end

    # source://sidekiq//lib/sidekiq.rb#221
    def default_server_middleware; end

    # deprecated
    #
    # source://activesupport/7.0.8.1/lib/active_support/deprecation/method_wrappers.rb#63
    def default_worker_options(*args, **_arg1, &block); end

    # deprecated
    #
    # source://activesupport/7.0.8.1/lib/active_support/deprecation/method_wrappers.rb#63
    def default_worker_options=(*args, **_arg1, &block); end

    # source://sidekiq//lib/sidekiq.rb#258
    def dump_json(object); end

    # @return [Boolean]
    #
    # source://sidekiq//lib/sidekiq.rb#294
    def ent?; end

    # Register a proc to handle any error which occurs within the Sidekiq process.
    #
    #   Sidekiq.configure_server do |config|
    #     config.error_handlers << proc {|ex,ctx_hash| MyErrorService.notify(ex, ctx_hash) }
    #   end
    #
    # The default error handler logs errors to Sidekiq.logger.
    #
    # source://sidekiq//lib/sidekiq.rb#314
    def error_handlers; end

    # source://sidekiq//lib/sidekiq.rb#118
    def fetch(*args, &block); end

    # source://sidekiq//lib/sidekiq.rb#122
    def handle_exception(ex, ctx = T.unsafe(nil)); end

    # source://sidekiq//lib/sidekiq.rb#254
    def load_json(string); end

    # source://sidekiq//lib/sidekiq.rb#262
    def log_formatter; end

    # source://sidekiq//lib/sidekiq.rb#270
    def log_formatter=(log_formatter); end

    # source://sidekiq//lib/sidekiq.rb#275
    def logger; end

    # source://sidekiq//lib/sidekiq.rb#279
    def logger=(logger); end

    # source://sidekiq//lib/sidekiq.rb#114
    def merge!(hash); end

    # Register a block to run at a point in the Sidekiq lifecycle.
    # :startup, :quiet or :shutdown are valid events.
    #
    #   Sidekiq.configure_server do |config|
    #     config.on(:shutdown) do
    #       puts "Goodbye cruel world!"
    #     end
    #   end
    #
    # @raise [ArgumentError]
    #
    # source://sidekiq//lib/sidekiq.rb#326
    def on(event, &block); end

    # source://sidekiq//lib/sidekiq.rb#96
    def options; end

    # source://sidekiq//lib/sidekiq.rb#101
    def options=(opts); end

    # @return [Boolean]
    #
    # source://sidekiq//lib/sidekiq.rb#290
    def pro?; end

    # config.queues = %w( high default low )                 # strict
    # config.queues = %w( high,3 default,2 low,1 )           # weighted
    # config.queues = %w( feature1,1 feature2,1 feature3,1 ) # random
    #
    # With weighted priority, queue will be checked first (weight / total) of the time.
    # high will be checked first (3/6) or 50% of the time.
    # I'd recommend setting weights between 1-10. Weights in the hundreds or thousands
    # are ridiculous and unnecessarily expensive. You can get random queue ordering
    # by explicitly setting all weights to 1.
    #
    # source://sidekiq//lib/sidekiq.rb#73
    def queues=(val); end

    # @raise [ArgumentError]
    #
    # source://sidekiq//lib/sidekiq.rb#159
    def redis; end

    # source://sidekiq//lib/sidekiq.rb#201
    def redis=(hash); end

    # source://sidekiq//lib/sidekiq.rb#181
    def redis_info; end

    # source://sidekiq//lib/sidekiq.rb#197
    def redis_pool; end

    # @return [Boolean]
    #
    # source://sidekiq//lib/sidekiq.rb#155
    def server?; end

    # @yield [@server_chain]
    #
    # source://sidekiq//lib/sidekiq.rb#215
    def server_middleware; end

    # source://sidekiq//lib/sidekiq.rb#332
    def strict_args!(mode = T.unsafe(nil)); end

    # source://sidekiq//lib/sidekiq/transaction_aware_client.rb#33
    def transactional_push!; end

    # source://sidekiq//lib/sidekiq.rb#55
    def ❨╯°□°❩╯︵┻━┻; end
  end
end

# source://sidekiq//lib/sidekiq/client.rb#8
class Sidekiq::Client
  include ::Sidekiq::JobUtil

  # Sidekiq::Client normally uses the default Redis pool but you may
  # pass a custom ConnectionPool if you want to shard your
  # Sidekiq jobs across several Redis instances (for scalability
  # reasons, e.g.)
  #
  #   Sidekiq::Client.new(ConnectionPool.new { Redis.new })
  #
  # Generally this is only needed for very large Sidekiq installs processing
  # thousands of jobs per second.  I don't recommend sharding unless you
  # cannot scale any other way (e.g. splitting your app into smaller apps).
  #
  # @return [Client] a new instance of Client
  #
  # source://sidekiq//lib/sidekiq/client.rb#44
  def initialize(redis_pool = T.unsafe(nil)); end

  # Define client-side middleware:
  #
  #   client = Sidekiq::Client.new
  #   client.middleware do |chain|
  #     chain.use MyClientMiddleware
  #   end
  #   client.push('class' => 'SomeJob', 'args' => [1,2,3])
  #
  # All client instances default to the globally-defined
  # Sidekiq.client_middleware but you can change as necessary.
  #
  # source://sidekiq//lib/sidekiq/client.rb#23
  def middleware(&block); end

  # The main method used to push a job to Redis.  Accepts a number of options:
  #
  #   queue - the named queue to use, default 'default'
  #   class - the job class to call, required
  #   args - an array of simple arguments to the perform method, must be JSON-serializable
  #   at - timestamp to schedule the job (optional), must be Numeric (e.g. Time.now.to_f)
  #   retry - whether to retry this job if it fails, default true or an integer number of retries
  #   backtrace - whether to save any error backtrace, default false
  #
  # If class is set to the class name, the jobs' options will be based on Sidekiq's default
  # job options. Otherwise, they will be based on the job class's options.
  #
  # Any options valid for a job class's sidekiq_options are also available here.
  #
  # All options must be strings, not symbols.  NB: because we are serializing to JSON, all
  # symbols in 'args' will be converted to strings.  Note that +backtrace: true+ can take quite a bit of
  # space in Redis; a large volume of failing jobs can start Redis swapping if you aren't careful.
  #
  # Returns a unique Job ID.  If middleware stops the job, nil will be returned instead.
  #
  # Example:
  #   push('queue' => 'my_queue', 'class' => MyJob, 'args' => ['foo', 1, :bat => 'bar'])
  #
  # source://sidekiq//lib/sidekiq/client.rb#72
  def push(item); end

  # Push a large number of jobs to Redis. This method cuts out the redis
  # network round trip latency.  I wouldn't recommend pushing more than
  # 1000 per call but YMMV based on network quality, size of job args, etc.
  # A large number of jobs can cause a bit of Redis command processing latency.
  #
  # Takes the same arguments as #push except that args is expected to be
  # an Array of Arrays.  All other keys are duplicated for each job.  Each job
  # is run through the client middleware pipeline and each job gets its own Job ID
  # as normal.
  #
  # Returns an array of the of pushed jobs' jids.  The number of jobs pushed can be less
  # than the number given if the middleware stopped processing for one or more jobs.
  #
  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/client.rb#97
  def push_bulk(items); end

  # Returns the value of attribute redis_pool.
  #
  # source://sidekiq//lib/sidekiq/client.rb#32
  def redis_pool; end

  # Sets the attribute redis_pool
  #
  # @param value the value to set the attribute redis_pool to.
  #
  # source://sidekiq//lib/sidekiq/client.rb#32
  def redis_pool=(_arg0); end

  private

  # source://sidekiq//lib/sidekiq/client.rb#221
  def atomic_push(conn, payloads); end

  # source://sidekiq//lib/sidekiq/client.rb#197
  def raw_push(payloads); end

  class << self
    # Resque compatibility helpers.  Note all helpers
    # should go through Sidekiq::Job#client_push.
    #
    # Example usage:
    #   Sidekiq::Client.enqueue(MyJob, 'foo', 1, :bat => 'bar')
    #
    # Messages are enqueued to the 'default' queue.
    #
    # source://sidekiq//lib/sidekiq/client.rb#162
    def enqueue(klass, *args); end

    # Example usage:
    #   Sidekiq::Client.enqueue_in(3.minutes, MyJob, 'foo', 1, :bat => 'bar')
    #
    # source://sidekiq//lib/sidekiq/client.rb#190
    def enqueue_in(interval, klass, *args); end

    # Example usage:
    #   Sidekiq::Client.enqueue_to(:queue_name, MyJob, 'foo', 1, :bat => 'bar')
    #
    # source://sidekiq//lib/sidekiq/client.rb#169
    def enqueue_to(queue, klass, *args); end

    # Example usage:
    #   Sidekiq::Client.enqueue_to_in(:queue_name, 3.minutes, MyJob, 'foo', 1, :bat => 'bar')
    #
    # source://sidekiq//lib/sidekiq/client.rb#176
    def enqueue_to_in(queue, interval, klass, *args); end

    # source://sidekiq//lib/sidekiq/client.rb#146
    def push(item); end

    # source://sidekiq//lib/sidekiq/client.rb#150
    def push_bulk(items); end

    # Allows sharding of jobs across any number of Redis instances.  All jobs
    # defined within the block will use the given Redis connection pool.
    #
    #   pool = ConnectionPool.new { Redis.new }
    #   Sidekiq::Client.via(pool) do
    #     SomeJob.perform_async(1,2,3)
    #     SomeOtherJob.perform_async(1,2,3)
    #   end
    #
    # Generally this is only needed for very large Sidekiq installs processing
    # thousands of jobs per second.  I do not recommend sharding unless
    # you cannot scale any other way (e.g. splitting your app into smaller apps).
    #
    # source://sidekiq//lib/sidekiq/client.rb#136
    def via(pool); end
  end
end

# no difference for now
#
# source://sidekiq//lib/sidekiq/middleware/modules.rb#20
Sidekiq::ClientMiddleware = Sidekiq::ServerMiddleware

# Sidekiq::Component assumes a config instance is available at @config
#
# source://sidekiq//lib/sidekiq/component.rb#4
module Sidekiq::Component
  # source://sidekiq//lib/sidekiq/component.rb#5
  def config; end

  # source://sidekiq//lib/sidekiq/component.rb#49
  def fire_event(event, options = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/component.rb#45
  def handle_exception(ex, ctx = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/component.rb#33
  def hostname; end

  # source://sidekiq//lib/sidekiq/component.rb#41
  def identity; end

  # source://sidekiq//lib/sidekiq/component.rb#21
  def logger; end

  # source://sidekiq//lib/sidekiq/component.rb#37
  def process_nonce; end

  # source://sidekiq//lib/sidekiq/component.rb#25
  def redis(&block); end

  # source://sidekiq//lib/sidekiq/component.rb#14
  def safe_thread(name, &block); end

  # source://sidekiq//lib/sidekiq/component.rb#29
  def tid; end

  # source://sidekiq//lib/sidekiq/component.rb#7
  def watchdog(last_words); end
end

# source://sidekiq//lib/sidekiq/logger.rb#7
module Sidekiq::Context
  class << self
    # source://sidekiq//lib/sidekiq/logger.rb#20
    def add(k, v); end

    # source://sidekiq//lib/sidekiq/logger.rb#16
    def current; end

    # source://sidekiq//lib/sidekiq/logger.rb#8
    def with(hash); end
  end
end

# source://sidekiq//lib/sidekiq.rb#20
Sidekiq::DEFAULTS = T.let(T.unsafe(nil), Hash)

# DEFAULT_ERROR_HANDLER is a constant that allows the default error handler to
# be referenced. It must be defined here, after the default_error_handler
# method is defined.
#
# source://sidekiq//lib/sidekiq.rb#93
Sidekiq::DEFAULT_ERROR_HANDLER = T.let(T.unsafe(nil), Method)

# The set of dead jobs within Sidekiq. Dead jobs have failed all of
# their retries and are helding in this set pending some sort of manual
# fix. They will be removed after 6 months (dead_timeout) if not.
#
# source://sidekiq//lib/sidekiq/api.rb#840
class Sidekiq::DeadSet < ::Sidekiq::JobSet
  # @return [DeadSet] a new instance of DeadSet
  #
  # source://sidekiq//lib/sidekiq/api.rb#841
  def initialize; end

  # Add the given job to the Dead set.
  #
  # @param message [String] the job data as JSON
  #
  # source://sidekiq//lib/sidekiq/api.rb#847
  def kill(message, opts = T.unsafe(nil)); end

  # Enqueue all dead jobs
  #
  # source://sidekiq//lib/sidekiq/api.rb#869
  def retry_all; end

  class << self
    # The maximum size of the Dead set. Older entries will be trimmed
    # to stay within this limit. Default value is 10,000.
    #
    # source://sidekiq//lib/sidekiq/api.rb#875
    def max_jobs; end

    # The time limit for entries within the Dead set. Older entries will be thrown away.
    # Default value is six months.
    #
    # source://sidekiq//lib/sidekiq/api.rb#881
    def timeout; end
  end
end

# source://sidekiq//lib/sidekiq/delay.rb#4
module Sidekiq::Extensions
  class << self
    # source://sidekiq//lib/sidekiq/delay.rb#5
    def enable_delay!; end
  end
end

# source://sidekiq//lib/sidekiq/delay.rb#28
module Sidekiq::Extensions::PsychAutoload
  # source://sidekiq//lib/sidekiq/delay.rb#29
  def resolve_class(klass_name); end
end

# source://sidekiq//lib/sidekiq.rb#47
Sidekiq::FAKE_INFO = T.let(T.unsafe(nil), Hash)

# source://sidekiq//lib/sidekiq/job.rb#12
Sidekiq::Job = Sidekiq::Worker

# Represents a pending job within a Sidekiq queue.
#
# The job should be considered immutable but may be
# removed from the queue via JobRecord#delete.
#
# source://sidekiq//lib/sidekiq/api.rb#349
class Sidekiq::JobRecord
  # @api private
  # @return [JobRecord] a new instance of JobRecord
  #
  # source://sidekiq//lib/sidekiq/api.rb#362
  def initialize(item, queue_name = T.unsafe(nil)); end

  # Access arbitrary attributes within the job hash
  #
  # source://sidekiq//lib/sidekiq/api.rb#485
  def [](name); end

  # source://sidekiq//lib/sidekiq/api.rb#441
  def args; end

  # source://sidekiq//lib/sidekiq/api.rb#453
  def created_at; end

  # Remove this job from the queue
  #
  # source://sidekiq//lib/sidekiq/api.rb#477
  def delete; end

  # source://sidekiq//lib/sidekiq/api.rb#410
  def display_args; end

  # source://sidekiq//lib/sidekiq/api.rb#388
  def display_class; end

  # source://sidekiq//lib/sidekiq/api.rb#449
  def enqueued_at; end

  # source://sidekiq//lib/sidekiq/api.rb#461
  def error_backtrace; end

  # the parsed Hash of job data
  #
  # source://sidekiq//lib/sidekiq/api.rb#352
  def item; end

  # source://sidekiq//lib/sidekiq/api.rb#445
  def jid; end

  # This is the job class which Sidekiq will execute. If using ActiveJob,
  # this class will be the ActiveJob adapter class rather than a specific job.
  #
  # source://sidekiq//lib/sidekiq/api.rb#384
  def klass; end

  # source://sidekiq//lib/sidekiq/api.rb#471
  def latency; end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#371
  def parse(item); end

  # the queue associated with this job
  #
  # source://sidekiq//lib/sidekiq/api.rb#358
  def queue; end

  # source://sidekiq//lib/sidekiq/api.rb#457
  def tags; end

  # the underlying String in Redis
  #
  # source://sidekiq//lib/sidekiq/api.rb#355
  def value; end

  private

  # source://sidekiq//lib/sidekiq/api.rb#494
  def safe_load(content, default); end

  # source://sidekiq//lib/sidekiq/api.rb#504
  def uncompress_backtrace(backtrace); end
end

# Base class for all sorted sets which contain jobs, e.g. scheduled, retry and dead.
# Sidekiq Pro and Enterprise add additional sorted sets which do not contain job data,
# e.g. Batches.
#
# source://sidekiq//lib/sidekiq/api.rb#687
class Sidekiq::JobSet < ::Sidekiq::SortedSet
  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#770
  def delete(score, jid); end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#770
  def delete_by_jid(score, jid); end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#760
  def delete_by_value(name, value); end

  # source://sidekiq//lib/sidekiq/api.rb#694
  def each; end

  # Fetch jobs that match a given time or Range. Job ID is an
  # optional second argument.
  #
  # @param score [Time, Range] a specific timestamp or range
  # @param jid [String, optional] find a specific JID within the score
  # @return [Array<SortedEntry>] any results found, can be empty
  #
  # source://sidekiq//lib/sidekiq/api.rb#722
  def fetch(score, jid = T.unsafe(nil)); end

  # Find the job with the given JID within this sorted set.
  # *This is a slow O(n) operation*.  Do not use for app logic.
  #
  # @param jid [String] the job identifier
  # @return [SortedEntry] the record or nil
  #
  # source://sidekiq//lib/sidekiq/api.rb#747
  def find_job(jid); end

  # Add a job with the associated timestamp to this set.
  #
  # @param timestamp [Time] the score for the job
  # @param job [Hash] the job data
  #
  # source://sidekiq//lib/sidekiq/api.rb#688
  def schedule(timestamp, job); end
end

# source://sidekiq//lib/sidekiq/job_util.rb#5
module Sidekiq::JobUtil
  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/job_util.rb#35
  def normalize_item(item); end

  # source://sidekiq//lib/sidekiq/job_util.rb#56
  def normalized_hash(item_class); end

  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/job_util.rb#10
  def validate(item); end

  # source://sidekiq//lib/sidekiq/job_util.rb#18
  def verify_json(item); end

  private

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/job_util.rb#67
  def json_safe?(item); end
end

# These functions encapsulate various job utilities.
#
# source://sidekiq//lib/sidekiq/job_util.rb#8
Sidekiq::JobUtil::TRANSIENT_ATTRIBUTES = T.let(T.unsafe(nil), Array)

# source://sidekiq//lib/sidekiq.rb#18
Sidekiq::LICENSE = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/logger.rb#95
class Sidekiq::Logger < ::Logger
  include ::Sidekiq::LoggingUtils

  # @return [Logger] a new instance of Logger
  #
  # source://sidekiq//lib/sidekiq/logger.rb#98
  def initialize(*args, **kwargs); end
end

# source://sidekiq//lib/sidekiq/logger.rb#103
module Sidekiq::Logger::Formatters; end

# source://sidekiq//lib/sidekiq/logger.rb#104
class Sidekiq::Logger::Formatters::Base < ::Logger::Formatter
  # source://sidekiq//lib/sidekiq/logger.rb#109
  def ctx; end

  # source://sidekiq//lib/sidekiq/logger.rb#113
  def format_context; end

  # source://sidekiq//lib/sidekiq/logger.rb#105
  def tid; end
end

# source://sidekiq//lib/sidekiq/logger.rb#139
class Sidekiq::Logger::Formatters::JSON < ::Sidekiq::Logger::Formatters::Base
  # source://sidekiq//lib/sidekiq/logger.rb#140
  def call(severity, time, program_name, message); end
end

# source://sidekiq//lib/sidekiq/logger.rb#127
class Sidekiq::Logger::Formatters::Pretty < ::Sidekiq::Logger::Formatters::Base
  # source://sidekiq//lib/sidekiq/logger.rb#128
  def call(severity, time, program_name, message); end
end

# source://sidekiq//lib/sidekiq/logger.rb#133
class Sidekiq::Logger::Formatters::WithoutTimestamp < ::Sidekiq::Logger::Formatters::Pretty
  # source://sidekiq//lib/sidekiq/logger.rb#134
  def call(severity, time, program_name, message); end
end

# source://sidekiq//lib/sidekiq/logger.rb#25
module Sidekiq::LoggingUtils
  # Redefined to check severity against #level, and thus the thread-local level, rather than +@level+.
  # FIXME: Remove when the minimum Ruby version supports overriding Logger#level.
  #
  # source://sidekiq//lib/sidekiq/logger.rb#76
  def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end

  # source://sidekiq//lib/sidekiq/logger.rb#39
  def debug?; end

  # source://sidekiq//lib/sidekiq/logger.rb#39
  def error?; end

  # source://sidekiq//lib/sidekiq/logger.rb#39
  def fatal?; end

  # source://sidekiq//lib/sidekiq/logger.rb#39
  def info?; end

  # source://sidekiq//lib/sidekiq/logger.rb#61
  def level; end

  # source://sidekiq//lib/sidekiq/logger.rb#44
  def local_level; end

  # source://sidekiq//lib/sidekiq/logger.rb#48
  def local_level=(level); end

  # Change the thread-local level for the duration of the given block.
  #
  # source://sidekiq//lib/sidekiq/logger.rb#66
  def log_at(level); end

  # source://sidekiq//lib/sidekiq/logger.rb#39
  def warn?; end
end

# source://sidekiq//lib/sidekiq/logger.rb#26
Sidekiq::LoggingUtils::LEVELS = T.let(T.unsafe(nil), Hash)

# Middleware is code configured to run before/after
# a job is processed.  It is patterned after Rack
# middleware. Middleware exists for the client side
# (pushing jobs onto the queue) as well as the server
# side (when jobs are actually processed).
#
# Callers will register middleware Classes and Sidekiq will
# create new instances of the middleware for every job. This
# is important so that instance state is not shared accidentally
# between job executions.
#
# To add middleware for the client:
#
#   Sidekiq.configure_client do |config|
#     config.client_middleware do |chain|
#       chain.add MyClientHook
#     end
#   end
#
# To modify middleware for the server, just call
# with another block:
#
#   Sidekiq.configure_server do |config|
#     config.server_middleware do |chain|
#       chain.add MyServerHook
#       chain.remove ActiveRecord
#     end
#   end
#
# To insert immediately preceding another entry:
#
#   Sidekiq.configure_client do |config|
#     config.client_middleware do |chain|
#       chain.insert_before ActiveRecord, MyClientHook
#     end
#   end
#
# To insert immediately after another entry:
#
#   Sidekiq.configure_client do |config|
#     config.client_middleware do |chain|
#       chain.insert_after ActiveRecord, MyClientHook
#     end
#   end
#
# This is an example of a minimal server middleware:
#
#   class MyServerHook
#     include Sidekiq::ServerMiddleware
#
#     def call(job_instance, msg, queue)
#       logger.info "Before job"
#       redis {|conn| conn.get("foo") } # do something in Redis
#       yield
#       logger.info "After job"
#     end
#   end
#
# This is an example of a minimal client middleware, note
# the method must return the result or the job will not push
# to Redis:
#
#   class MyClientHook
#     include Sidekiq::ClientMiddleware
#
#     def call(job_class, msg, queue, redis_pool)
#       logger.info "Before push"
#       result = yield
#       logger.info "After push"
#       result
#     end
#   end
#
# source://sidekiq//lib/sidekiq/middleware/chain.rb#79
module Sidekiq::Middleware; end

# source://sidekiq//lib/sidekiq/middleware/chain.rb#80
class Sidekiq::Middleware::Chain
  include ::Enumerable

  # @api private
  # @return [Chain] a new instance of Chain
  # @yield [_self]
  # @yieldparam _self [Sidekiq::Middleware::Chain] the object that the method was called on
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#98
  def initialize(config = T.unsafe(nil)); end

  # Add the given middleware to the end of the chain.
  # Sidekiq will call `klass.new(*args)` to create a clean
  # copy of your middleware for every job executed.
  #
  #   chain.add(Statsd::Metrics, { collector: "localhost:8125" })
  #
  # @param klass [Class] Your middleware class
  # @param *args [Array<Object>] Set of arguments to pass to every instance of your middleware
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#122
  def add(klass, *args); end

  # source://sidekiq//lib/sidekiq/middleware/chain.rb#165
  def clear; end

  # Iterate through each middleware in the chain
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#93
  def each(&block); end

  # @return [Boolean] if the chain contains no middleware
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#157
  def empty?; end

  # source://sidekiq//lib/sidekiq/middleware/chain.rb#104
  def entries; end

  # @return [Boolean] if the given class is already in the chain
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#152
  def exists?(klass); end

  # Inserts +newklass+ after +oldklass+ in the chain.
  # Useful if one middleware must run after another middleware.
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#144
  def insert_after(oldklass, newklass, *args); end

  # Inserts +newklass+ before +oldklass+ in the chain.
  # Useful if one middleware must run before another middleware.
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#135
  def insert_before(oldklass, newklass, *args); end

  # Used by Sidekiq to execute the middleware at runtime
  #
  # @api private
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#171
  def invoke(*args); end

  # Identical to {#add} except the middleware is added to the front of the chain.
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#128
  def prepend(klass, *args); end

  # Remove all middleware matching the given Class
  #
  # @param klass [Class]
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#110
  def remove(klass); end

  # source://sidekiq//lib/sidekiq/middleware/chain.rb#161
  def retrieve; end

  private

  # A unique instance of the middleware chain is created for
  # each job executed in order to be thread-safe.
  #
  # @param copy [Sidekiq::Middleware::Chain] New instance of Chain
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#87
  def initialize_copy(copy); end
end

# Represents each link in the middleware chain
#
# @api private
#
# source://sidekiq//lib/sidekiq/middleware/chain.rb#190
class Sidekiq::Middleware::Entry
  # @api private
  # @return [Entry] a new instance of Entry
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#193
  def initialize(config, klass, *args); end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#191
  def klass; end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/middleware/chain.rb#199
  def make_new; end
end

# source://sidekiq//lib/sidekiq.rb#17
Sidekiq::NAME = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/paginator.rb#4
module Sidekiq::Paginator
  # source://sidekiq//lib/sidekiq/paginator.rb#5
  def page(key, pageidx = T.unsafe(nil), page_size = T.unsafe(nil), opts = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/paginator.rb#47
  def page_items(items, pageidx = T.unsafe(nil), page_size = T.unsafe(nil)); end
end

# Sidekiq::Process represents an active Sidekiq process talking with Redis.
# Each process has a set of attributes which look like this:
#
# {
#   'hostname' => 'app-1.example.com',
#   'started_at' => <process start time>,
#   'pid' => 12345,
#   'tag' => 'myapp'
#   'concurrency' => 25,
#   'queues' => ['default', 'low'],
#   'busy' => 10,
#   'beat' => <last heartbeat>,
#   'identity' => <unique string identifying the process>,
# }
#
# source://sidekiq//lib/sidekiq/api.rb#1012
class Sidekiq::Process
  # @api private
  # @return [Process] a new instance of Process
  #
  # source://sidekiq//lib/sidekiq/api.rb#1015
  def initialize(hash); end

  # source://sidekiq//lib/sidekiq/api.rb#1027
  def [](key); end

  # Signal this process to log backtraces for all threads.
  # Useful if you have a frozen or deadlocked process which is
  # still sending a heartbeat.
  # This method is *asynchronous* and it can take 5-10 seconds.
  #
  # source://sidekiq//lib/sidekiq/api.rb#1059
  def dump_threads; end

  # source://sidekiq//lib/sidekiq/api.rb#1031
  def identity; end

  # source://sidekiq//lib/sidekiq/api.rb#1023
  def labels; end

  # source://sidekiq//lib/sidekiq/api.rb#1035
  def queues; end

  # Signal this process to stop processing new jobs.
  # It will continue to execute jobs it has already fetched.
  # This method is *asynchronous* and it can take 5-10
  # seconds for the process to quiet.
  #
  # source://sidekiq//lib/sidekiq/api.rb#1043
  def quiet!; end

  # Signal this process to shutdown.
  # It will shutdown within its configured :timeout value, default 25 seconds.
  # This method is *asynchronous* and it can take 5-10
  # seconds for the process to start shutting down.
  #
  # source://sidekiq//lib/sidekiq/api.rb#1051
  def stop!; end

  # @return [Boolean] true if this process is quiet or shutting down
  #
  # source://sidekiq//lib/sidekiq/api.rb#1064
  def stopping?; end

  # source://sidekiq//lib/sidekiq/api.rb#1019
  def tag; end

  private

  # source://sidekiq//lib/sidekiq/api.rb#1070
  def signal(sig); end
end

# Enumerates the set of Sidekiq processes which are actively working
# right now.  Each process sends a heartbeat to Redis every 5 seconds
# so this set should be relatively accurate, barring network partitions.
#
# @yieldparam [Sidekiq::Process]
#
# source://sidekiq//lib/sidekiq/api.rb#893
class Sidekiq::ProcessSet
  include ::Enumerable

  # @api private
  # @return [ProcessSet] a new instance of ProcessSet
  #
  # source://sidekiq//lib/sidekiq/api.rb#898
  def initialize(clean_plz = T.unsafe(nil)); end

  # Cleans up dead processes recorded in Redis.
  # Returns the number of processes cleaned.
  #
  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#906
  def cleanup; end

  # source://sidekiq//lib/sidekiq/api.rb#930
  def each; end

  # Returns the identity of the current cluster leader or "" if no leader.
  # This is a Sidekiq Enterprise feature, will always return "" in Sidekiq
  # or Sidekiq Pro.
  #
  # @return [String] Identity of cluster leader
  # @return [String] empty string if no leader
  #
  # source://sidekiq//lib/sidekiq/api.rb#987
  def leader; end

  # This method is not guaranteed accurate since it does not prune the set
  # based on current heartbeat.  #each does that and ensures the set only
  # contains Sidekiq processes which have sent a heartbeat within the last
  # 60 seconds.
  #
  # @return [Integer] current number of registered Sidekiq processes
  #
  # source://sidekiq//lib/sidekiq/api.rb#964
  def size; end

  # source://sidekiq//lib/sidekiq/api.rb#972
  def total_concurrency; end

  # @return [Integer] total amount of RSS memory consumed by Sidekiq processes
  #
  # source://sidekiq//lib/sidekiq/api.rb#977
  def total_rss; end

  # @return [Integer] total amount of RSS memory consumed by Sidekiq processes
  #
  # source://sidekiq//lib/sidekiq/api.rb#977
  def total_rss_in_kb; end
end

# Represents a queue within Sidekiq.
# Allows enumeration of all jobs within the queue
# and deletion of jobs. NB: this queue data is real-time
# and is changing within Redis moment by moment.
#
#   queue = Sidekiq::Queue.new("mailer")
#   queue.each do |job|
#     job.klass # => 'MyWorker'
#     job.args # => [1, 2, 3]
#     job.delete if job.jid == 'abcdef1234567890'
#   end
#
# source://sidekiq//lib/sidekiq/api.rb#242
class Sidekiq::Queue
  include ::Enumerable

  # @param name [String] the name of the queue
  # @return [Queue] a new instance of Queue
  #
  # source://sidekiq//lib/sidekiq/api.rb#256
  def initialize(name = T.unsafe(nil)); end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#339
  def as_json(options = T.unsafe(nil)); end

  # delete all jobs within this queue
  #
  # @return [Boolean] true
  #
  # source://sidekiq//lib/sidekiq/api.rb#326
  def clear; end

  # source://sidekiq//lib/sidekiq/api.rb#290
  def each; end

  # Find the job with the given JID within this queue.
  #
  # This is a *slow, inefficient* operation.  Do not use under
  # normal conditions.
  #
  # @param jid [String] the job_id to look for
  # @return [Sidekiq::JobRecord]
  # @return [nil] if not found
  #
  # source://sidekiq//lib/sidekiq/api.rb#320
  def find_job(jid); end

  # Calculates this queue's latency, the difference in seconds since the oldest
  # job in the queue was enqueued.
  #
  # @return [Float] in seconds
  #
  # source://sidekiq//lib/sidekiq/api.rb#279
  def latency; end

  # Returns the value of attribute name.
  #
  # source://sidekiq//lib/sidekiq/api.rb#253
  def name; end

  # @return [Boolean] if the queue is currently paused
  #
  # source://sidekiq//lib/sidekiq/api.rb#270
  def paused?; end

  # The current size of the queue within Redis.
  # This value is real-time and can change between calls.
  #
  # @return [Integer] the size
  #
  # source://sidekiq//lib/sidekiq/api.rb#265
  def size; end

  # delete all jobs within this queue
  #
  # @return [Boolean] true
  #
  # source://sidekiq//lib/sidekiq/api.rb#326
  def 💣; end

  class << self
    # Fetch all known queues within Redis.
    #
    # @return [Array<Sidekiq::Queue>]
    #
    # source://sidekiq//lib/sidekiq/api.rb#249
    def all; end
  end
end

# source://sidekiq//lib/sidekiq/rails.rb#6
class Sidekiq::Rails < ::Rails::Engine
  class << self
    # source://activesupport/7.0.8.1/lib/active_support/callbacks.rb#68
    def __callbacks; end
  end
end

# source://sidekiq//lib/sidekiq/rails.rb#7
class Sidekiq::Rails::Reloader
  # @return [Reloader] a new instance of Reloader
  #
  # source://sidekiq//lib/sidekiq/rails.rb#8
  def initialize(app = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/rails.rb#12
  def call; end

  # source://sidekiq//lib/sidekiq/rails.rb#18
  def inspect; end
end

# source://sidekiq//lib/sidekiq/redis_connection.rb#8
module Sidekiq::RedisConnection
  class << self
    # Returns the value of attribute adapter.
    #
    # source://sidekiq//lib/sidekiq/redis_connection.rb#63
    def adapter; end

    # RedisConnection.adapter = :redis
    # RedisConnection.adapter = :redis_client
    #
    # source://sidekiq//lib/sidekiq/redis_connection.rb#67
    def adapter=(adapter); end

    # source://sidekiq//lib/sidekiq/redis_connection.rb#81
    def create(options = T.unsafe(nil)); end

    private

    # source://sidekiq//lib/sidekiq/redis_connection.rb#150
    def determine_redis_provider; end

    # source://sidekiq//lib/sidekiq/redis_connection.rb#125
    def log_info(options); end

    # Sidekiq needs many concurrent Redis connections.
    #
    # We need a connection for each Processor.
    # We need a connection for Pro's real-time change listener
    # We need a connection to various features to call Redis every few seconds:
    #   - the process heartbeat.
    #   - enterprise's leader election
    #   - enterprise's cron support
    #
    # @raise [ArgumentError]
    #
    # source://sidekiq//lib/sidekiq/redis_connection.rb#121
    def verify_sizing(size, concurrency); end
  end
end

# source://sidekiq//lib/sidekiq/redis_connection.rb#9
class Sidekiq::RedisConnection::RedisAdapter
  # @return [RedisAdapter] a new instance of RedisAdapter
  #
  # source://sidekiq//lib/sidekiq/redis_connection.rb#13
  def initialize(options); end

  # source://sidekiq//lib/sidekiq/redis_connection.rb#18
  def new_client; end

  private

  # source://sidekiq//lib/sidekiq/redis_connection.rb#38
  def client_opts(options); end
end

# source://sidekiq//lib/sidekiq/redis_connection.rb#10
Sidekiq::RedisConnection::RedisAdapter::BaseError = Redis::BaseError

# source://sidekiq//lib/sidekiq/redis_connection.rb#11
Sidekiq::RedisConnection::RedisAdapter::CommandError = Redis::CommandError

# The set of retries within Sidekiq.
# Based on this, you can search/filter for jobs.  Here's an
# example where I'm selecting all jobs of a certain type
# and deleting them from the retry queue.
#
#   r = Sidekiq::RetrySet.new
#   r.select do |retri|
#     retri.klass == 'Sidekiq::Extensions::DelayedClass' &&
#     retri.args[0] == 'User' &&
#     retri.args[1] == 'setup_new_subscriber'
#   end.map(&:delete)
#
# source://sidekiq//lib/sidekiq/api.rb#819
class Sidekiq::RetrySet < ::Sidekiq::JobSet
  # @return [RetrySet] a new instance of RetrySet
  #
  # source://sidekiq//lib/sidekiq/api.rb#820
  def initialize; end

  # Kills all jobs pending within the retry set.
  #
  # source://sidekiq//lib/sidekiq/api.rb#830
  def kill_all; end

  # Enqueues all jobs pending within the retry set.
  #
  # source://sidekiq//lib/sidekiq/api.rb#825
  def retry_all; end
end

# source://sidekiq//lib/sidekiq/scheduled.rb#7
module Sidekiq::Scheduled; end

# source://sidekiq//lib/sidekiq/scheduled.rb#10
class Sidekiq::Scheduled::Enq
  # @return [Enq] a new instance of Enq
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#20
  def initialize; end

  # source://sidekiq//lib/sidekiq/scheduled.rb#25
  def enqueue_jobs(sorted_sets = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/scheduled.rb#42
  def terminate; end

  private

  # source://sidekiq//lib/sidekiq/scheduled.rb#48
  def zpopbyscore(conn, keys: T.unsafe(nil), argv: T.unsafe(nil)); end
end

# source://sidekiq//lib/sidekiq/scheduled.rb#11
Sidekiq::Scheduled::Enq::LUA_ZPOPBYSCORE = T.let(T.unsafe(nil), String)

# The Poller checks Redis every N seconds for jobs in the retry or scheduled
# set have passed their timestamp and should be enqueued.  If so, it
# just pops the job back onto its original queue so the
# workers can pick it up like any other job.
#
# source://sidekiq//lib/sidekiq/scheduled.rb#68
class Sidekiq::Scheduled::Poller
  include ::Sidekiq::Component

  # @return [Poller] a new instance of Poller
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#73
  def initialize(options); end

  # source://sidekiq//lib/sidekiq/scheduled.rb#107
  def enqueue; end

  # source://sidekiq//lib/sidekiq/scheduled.rb#95
  def start; end

  # Shut down this instance, will pause until the thread is dead.
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#83
  def terminate; end

  private

  # A copy of Sidekiq::ProcessSet#cleanup because server
  # should never depend on sidekiq/api.
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#195
  def cleanup; end

  # source://sidekiq//lib/sidekiq/scheduled.rb#219
  def initial_wait; end

  # We do our best to tune the poll interval to the size of the active Sidekiq
  # cluster.  If you have 30 processes and poll every 15 seconds, that means one
  # Sidekiq is checking Redis every 0.5 seconds - way too often for most people
  # and really bad if the retry or scheduled sets are large.
  #
  # Instead try to avoid polling more than once every 15 seconds.  If you have
  # 30 Sidekiq processes, we'll poll every 30 * 15 or 450 seconds.
  # To keep things statistically random, we'll sleep a random amount between
  # 225 and 675 seconds for each poll or 450 seconds on average.  Otherwise restarting
  # all your Sidekiq processes at the same time will lead to them all polling at
  # the same time: the thundering herd problem.
  #
  # We only do this if poll_interval_average is unset (the default).
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#176
  def poll_interval_average(count); end

  # source://sidekiq//lib/sidekiq/scheduled.rb#187
  def process_count; end

  # source://sidekiq//lib/sidekiq/scheduled.rb#130
  def random_poll_interval; end

  # Calculates an average poll interval based on the number of known Sidekiq processes.
  # This minimizes a single point of failure by dispersing check-ins but without taxing
  # Redis if you run many Sidekiq processes.
  #
  # source://sidekiq//lib/sidekiq/scheduled.rb#183
  def scaled_poll_interval(process_count); end

  # source://sidekiq//lib/sidekiq/scheduled.rb#118
  def wait; end
end

# source://sidekiq//lib/sidekiq/scheduled.rb#71
Sidekiq::Scheduled::Poller::INITIAL_WAIT = T.let(T.unsafe(nil), Integer)

# source://sidekiq//lib/sidekiq/scheduled.rb#8
Sidekiq::Scheduled::SETS = T.let(T.unsafe(nil), Array)

# The set of scheduled jobs within Sidekiq.
# Based on this, you can search/filter for jobs.  Here's an
# example where I'm selecting jobs based on some complex logic
# and deleting them from the scheduled set.
#
#   r = Sidekiq::ScheduledSet.new
#   r.select do |scheduled|
#     scheduled.klass == 'Sidekiq::Extensions::DelayedClass' &&
#     scheduled.args[0] == 'User' &&
#     scheduled.args[1] == 'setup_new_subscriber'
#   end.map(&:delete)
#
# source://sidekiq//lib/sidekiq/api.rb#801
class Sidekiq::ScheduledSet < ::Sidekiq::JobSet
  # @return [ScheduledSet] a new instance of ScheduledSet
  #
  # source://sidekiq//lib/sidekiq/api.rb#802
  def initialize; end
end

# Server-side middleware must import this Module in order
# to get access to server resources during `call`.
#
# source://sidekiq//lib/sidekiq/middleware/modules.rb#4
module Sidekiq::ServerMiddleware
  # Returns the value of attribute config.
  #
  # source://sidekiq//lib/sidekiq/middleware/modules.rb#5
  def config; end

  # Sets the attribute config
  #
  # @param value the value to set the attribute config to.
  #
  # source://sidekiq//lib/sidekiq/middleware/modules.rb#5
  def config=(_arg0); end

  # source://sidekiq//lib/sidekiq/middleware/modules.rb#10
  def logger; end

  # source://sidekiq//lib/sidekiq/middleware/modules.rb#14
  def redis(&block); end

  # source://sidekiq//lib/sidekiq/middleware/modules.rb#6
  def redis_pool; end
end

# We are shutting down Sidekiq but what about threads that
# are working on some long job?  This error is
# raised in jobs that have not finished within the hard
# timeout limit.  This is needed to rollback db transactions,
# otherwise Ruby's Thread#kill will commit.  See #377.
# DO NOT RESCUE THIS ERROR IN YOUR JOBS
#
# source://sidekiq//lib/sidekiq.rb#342
class Sidekiq::Shutdown < ::Interrupt; end

# Represents a job within a Redis sorted set where the score
# represents a timestamp associated with the job. This timestamp
# could be the scheduled time for it to run (e.g. scheduled set),
# or the expiration date after which the entry should be deleted (e.g. dead set).
#
# source://sidekiq//lib/sidekiq/api.rb#526
class Sidekiq::SortedEntry < ::Sidekiq::JobRecord
  # @api private
  # @return [SortedEntry] a new instance of SortedEntry
  #
  # source://sidekiq//lib/sidekiq/api.rb#532
  def initialize(parent, score, item); end

  # Enqueue this job from the scheduled or dead set so it will
  # be executed at some point in the near future.
  #
  # source://sidekiq//lib/sidekiq/api.rb#563
  def add_to_queue; end

  # The timestamp associated with this entry
  #
  # source://sidekiq//lib/sidekiq/api.rb#539
  def at; end

  # remove this entry from the sorted set
  #
  # source://sidekiq//lib/sidekiq/api.rb#544
  def delete; end

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/api.rb#587
  def error?; end

  # Move this job from its current set into the Dead set.
  #
  # source://sidekiq//lib/sidekiq/api.rb#581
  def kill; end

  # Returns the value of attribute parent.
  #
  # source://sidekiq//lib/sidekiq/api.rb#528
  def parent; end

  # Change the scheduled time for this job.
  #
  # @param at [Time] the new timestamp for this job
  #
  # source://sidekiq//lib/sidekiq/api.rb#555
  def reschedule(at); end

  # enqueue this job from the retry set so it will be executed
  # at some point in the near future.
  #
  # source://sidekiq//lib/sidekiq/api.rb#572
  def retry; end

  # Returns the value of attribute score.
  #
  # source://sidekiq//lib/sidekiq/api.rb#527
  def score; end

  private

  # source://sidekiq//lib/sidekiq/api.rb#593
  def remove_job; end
end

# Base class for all sorted sets within Sidekiq.
#
# source://sidekiq//lib/sidekiq/api.rb#629
class Sidekiq::SortedSet
  include ::Enumerable

  # @api private
  # @return [SortedSet] a new instance of SortedSet
  #
  # source://sidekiq//lib/sidekiq/api.rb#638
  def initialize(name); end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#676
  def as_json(options = T.unsafe(nil)); end

  # @return [Boolean] always true
  #
  # source://sidekiq//lib/sidekiq/api.rb#666
  def clear; end

  # Redis key of the set
  #
  # source://sidekiq//lib/sidekiq/api.rb#634
  def name; end

  # Scan through each element of the sorted set, yielding each to the supplied block.
  # Please see Redis's <a href="https://redis.io/commands/scan/">SCAN documentation</a> for implementation details.
  #
  # @param match [String] a snippet or regexp to filter matches.
  # @param count [Integer] number of elements to retrieve at a time, default 100
  # @yieldparam each [Sidekiq::SortedEntry] entry
  #
  # source://sidekiq//lib/sidekiq/api.rb#654
  def scan(match, count = T.unsafe(nil)); end

  # real-time size of the set, will change
  #
  # source://sidekiq//lib/sidekiq/api.rb#644
  def size; end

  # @return [Boolean] always true
  #
  # source://sidekiq//lib/sidekiq/api.rb#666
  def 💣; end
end

# Retrieve runtime statistics from Redis regarding
# this Sidekiq cluster.
#
#   stat = Sidekiq::Stats.new
#   stat.processed
#
# source://sidekiq//lib/sidekiq/api.rb#31
class Sidekiq::Stats
  # @return [Stats] a new instance of Stats
  #
  # source://sidekiq//lib/sidekiq/api.rb#32
  def initialize; end

  # source://sidekiq//lib/sidekiq/api.rb#52
  def dead_size; end

  # source://sidekiq//lib/sidekiq/api.rb#68
  def default_queue_latency; end

  # source://sidekiq//lib/sidekiq/api.rb#56
  def enqueued; end

  # source://sidekiq//lib/sidekiq/api.rb#40
  def failed; end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#144
  def fetch_stats!; end

  # O(1) redis calls
  #
  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#78
  def fetch_stats_fast!; end

  # O(number of processes + number of queues) redis calls
  #
  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#118
  def fetch_stats_slow!; end

  # source://sidekiq//lib/sidekiq/api.rb#36
  def processed; end

  # source://sidekiq//lib/sidekiq/api.rb#60
  def processes_size; end

  # source://sidekiq//lib/sidekiq/api.rb#72
  def queues; end

  # @api private
  #
  # source://sidekiq//lib/sidekiq/api.rb#150
  def reset(*stats); end

  # source://sidekiq//lib/sidekiq/api.rb#48
  def retry_size; end

  # source://sidekiq//lib/sidekiq/api.rb#44
  def scheduled_size; end

  # source://sidekiq//lib/sidekiq/api.rb#64
  def workers_size; end

  private

  # source://sidekiq//lib/sidekiq/api.rb#166
  def stat(s); end
end

# source://sidekiq//lib/sidekiq/api.rb#188
class Sidekiq::Stats::History
  # @raise [ArgumentError]
  # @return [History] a new instance of History
  #
  # source://sidekiq//lib/sidekiq/api.rb#189
  def initialize(days_previous, start_date = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/api.rb#200
  def failed; end

  # source://sidekiq//lib/sidekiq/api.rb#196
  def processed; end

  private

  # source://sidekiq//lib/sidekiq/api.rb#206
  def date_stat_hash(stat); end
end

# source://sidekiq//lib/sidekiq/api.rb#171
class Sidekiq::Stats::Queues
  # source://sidekiq//lib/sidekiq/api.rb#172
  def lengths; end
end

# source://sidekiq//lib/sidekiq/transaction_aware_client.rb#7
class Sidekiq::TransactionAwareClient
  # @return [TransactionAwareClient] a new instance of TransactionAwareClient
  #
  # source://sidekiq//lib/sidekiq/transaction_aware_client.rb#8
  def initialize(redis_pool); end

  # source://sidekiq//lib/sidekiq/transaction_aware_client.rb#12
  def push(item); end

  # We don't provide transactionality for push_bulk because we don't want
  # to hold potentially hundreds of thousands of job records in memory due to
  # a long running enqueue process.
  #
  # source://sidekiq//lib/sidekiq/transaction_aware_client.rb#24
  def push_bulk(items); end
end

# source://sidekiq//lib/sidekiq/version.rb#4
Sidekiq::VERSION = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/csrf_protection.rb#34
class Sidekiq::Web
  # source://sidekiq//lib/sidekiq/web.rb#120
  def app; end

  # source://sidekiq//lib/sidekiq/web.rb#111
  def call(env); end

  # source://sidekiq//lib/sidekiq/web.rb#128
  def disable(*opts); end

  # source://sidekiq//lib/sidekiq/web.rb#124
  def enable(*opts); end

  # source://sidekiq//lib/sidekiq/web.rb#103
  def middlewares; end

  # source://sidekiq//lib/sidekiq/web.rb#136
  def sessions=(val); end

  # source://sidekiq//lib/sidekiq/web.rb#132
  def set(attribute, value); end

  # source://sidekiq//lib/sidekiq/web.rb#99
  def settings; end

  # source://sidekiq//lib/sidekiq/web.rb#107
  def use(*args, &block); end

  private

  # source://sidekiq//lib/sidekiq/web.rb#146
  def build; end

  class << self
    # Returns the value of attribute app_url.
    #
    # source://sidekiq//lib/sidekiq/web.rb#90
    def app_url; end

    # Sets the attribute app_url
    #
    # @param value the value to set the attribute app_url to.
    #
    # source://sidekiq//lib/sidekiq/web.rb#90
    def app_url=(_arg0); end

    # source://sidekiq//lib/sidekiq/web.rb#115
    def call(env); end

    # source://sidekiq//lib/sidekiq/web.rb#49
    def custom_tabs; end

    # source://sidekiq//lib/sidekiq/web.rb#45
    def default_tabs; end

    # source://sidekiq//lib/sidekiq/web.rb#66
    def disable(*opts); end

    # source://sidekiq//lib/sidekiq/web.rb#62
    def enable(*opts); end

    # @private
    #
    # source://sidekiq//lib/sidekiq/web.rb#94
    def inherited(child); end

    # source://sidekiq//lib/sidekiq/web.rb#54
    def locales; end

    # Sets the attribute locales
    #
    # @param value the value to set the attribute locales to.
    #
    # source://sidekiq//lib/sidekiq/web.rb#91
    def locales=(_arg0); end

    # source://sidekiq//lib/sidekiq/web.rb#70
    def middlewares; end

    # Returns the value of attribute redis_pool.
    #
    # source://sidekiq//lib/sidekiq/web.rb#90
    def redis_pool; end

    # Sets the attribute redis_pool
    #
    # @param value the value to set the attribute redis_pool to.
    #
    # source://sidekiq//lib/sidekiq/web.rb#90
    def redis_pool=(_arg0); end

    # source://sidekiq//lib/sidekiq/web.rb#140
    def register(extension); end

    # source://sidekiq//lib/sidekiq/web.rb#86
    def session_secret=(val); end

    # source://sidekiq//lib/sidekiq/web.rb#82
    def sessions=(val); end

    # source://sidekiq//lib/sidekiq/web.rb#78
    def set(attribute, value); end

    # source://sidekiq//lib/sidekiq/web.rb#41
    def settings; end

    # source://sidekiq//lib/sidekiq/web.rb#49
    def tabs; end

    # source://sidekiq//lib/sidekiq/web.rb#74
    def use(*args, &block); end

    # source://sidekiq//lib/sidekiq/web.rb#58
    def views; end

    # Sets the attribute views
    #
    # @param value the value to set the attribute views to.
    #
    # source://sidekiq//lib/sidekiq/web.rb#91
    def views=(_arg0); end
  end
end

# source://sidekiq//lib/sidekiq/web.rb#25
Sidekiq::Web::ASSETS = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/csrf_protection.rb#35
class Sidekiq::Web::CsrfProtection
  # @return [CsrfProtection] a new instance of CsrfProtection
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#36
  def initialize(app, options = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#40
  def call(env); end

  private

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#96
  def accept?(env); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#46
  def admit(env); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#167
  def compare_with_real_token(token, local); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#171
  def decode_token(token); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#63
  def deny(env); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#59
  def logger(env); end

  # Creates a masked version of the authenticity token that varies
  # on each request. The masking is used to mitigate SSL attacks
  # like BREACH.
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#141
  def mask_token(token); end

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#163
  def masked_token?(token); end

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#55
  def safe?(env); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#68
  def session(env); end

  # Essentially the inverse of +mask_token+.
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#150
  def unmask_token(masked_token); end

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#159
  def unmasked_token?(token); end

  # Checks that the token given to us as a parameter matches
  # the token stored in the session.
  #
  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#107
  def valid_token?(env, giventoken); end

  # source://sidekiq//lib/sidekiq/web/csrf_protection.rb#175
  def xor_byte_strings(s1, s2); end
end

# source://sidekiq//lib/sidekiq/web/csrf_protection.rb#103
Sidekiq::Web::CsrfProtection::TOKEN_LENGTH = T.let(T.unsafe(nil), Integer)

# source://sidekiq//lib/sidekiq/web.rb#27
Sidekiq::Web::DEFAULT_TABS = T.let(T.unsafe(nil), Hash)

# source://sidekiq//lib/sidekiq/web.rb#24
Sidekiq::Web::LAYOUT = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web.rb#23
Sidekiq::Web::LOCALES = T.let(T.unsafe(nil), Array)

# source://sidekiq//lib/sidekiq/web.rb#21
Sidekiq::Web::ROOT = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web.rb#22
Sidekiq::Web::VIEWS = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/action.rb#4
class Sidekiq::WebAction
  include ::Sidekiq::WebHelpers
  include ::Sidekiq::Paginator

  # @return [WebAction] a new instance of WebAction
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#74
  def initialize(env, block); end

  # source://sidekiq//lib/sidekiq/web.rb#169
  def _render; end

  # Returns the value of attribute block.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def block; end

  # Sets the attribute block
  #
  # @param value the value to set the attribute block to.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def block=(_arg0); end

  # Returns the value of attribute env.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def env; end

  # Sets the attribute env
  #
  # @param value the value to set the attribute env to.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def env=(_arg0); end

  # source://sidekiq//lib/sidekiq/web/action.rb#42
  def erb(content, options = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/action.rb#17
  def halt(res); end

  # source://sidekiq//lib/sidekiq/web/action.rb#70
  def json(payload); end

  # source://sidekiq//lib/sidekiq/web/action.rb#25
  def params; end

  # source://sidekiq//lib/sidekiq/web/action.rb#21
  def redirect(location); end

  # source://sidekiq//lib/sidekiq/web/action.rb#64
  def render(engine, content, options = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/action.rb#13
  def request; end

  # source://sidekiq//lib/sidekiq/web/action.rb#34
  def route_params; end

  # source://sidekiq//lib/sidekiq/web/action.rb#38
  def session; end

  # source://sidekiq//lib/sidekiq/web/action.rb#9
  def settings; end

  # Returns the value of attribute type.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def type; end

  # Sets the attribute type
  #
  # @param value the value to set the attribute type to.
  #
  # source://sidekiq//lib/sidekiq/web/action.rb#7
  def type=(_arg0); end

  private

  # source://sidekiq//lib/sidekiq/web/action.rb#83
  def _erb(file, locals); end
end

# source://sidekiq//lib/sidekiq/web/action.rb#5
Sidekiq::WebAction::RACK_SESSION = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/application.rb#4
class Sidekiq::WebApplication
  extend ::Sidekiq::WebRouter

  # @return [WebApplication] a new instance of WebApplication
  #
  # source://sidekiq//lib/sidekiq/web/application.rb#24
  def initialize(klass); end

  # source://sidekiq//lib/sidekiq/web/application.rb#316
  def call(env); end

  # source://sidekiq//lib/sidekiq/web/application.rb#28
  def settings; end

  class << self
    # source://sidekiq//lib/sidekiq/web/application.rb#357
    def after(path = T.unsafe(nil), &block); end

    # source://sidekiq//lib/sidekiq/web/application.rb#378
    def afters; end

    # source://sidekiq//lib/sidekiq/web/application.rb#353
    def before(path = T.unsafe(nil), &block); end

    # source://sidekiq//lib/sidekiq/web/application.rb#374
    def befores; end

    # source://sidekiq//lib/sidekiq/web/application.rb#345
    def helpers(mod = T.unsafe(nil), &block); end

    # source://sidekiq//lib/sidekiq/web/application.rb#365
    def run_afters(app, action); end

    # source://sidekiq//lib/sidekiq/web/application.rb#361
    def run_befores(app, action); end

    # source://sidekiq//lib/sidekiq/web/application.rb#369
    def run_hooks(hooks, app, action); end

    # source://sidekiq//lib/sidekiq/web/application.rb#40
    def set(key, val); end

    # source://sidekiq//lib/sidekiq/web/application.rb#32
    def settings; end

    # source://sidekiq//lib/sidekiq/web/application.rb#36
    def tabs; end
  end
end

# source://sidekiq//lib/sidekiq/web/application.rb#8
Sidekiq::WebApplication::CSP_HEADER = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/application.rb#104
Sidekiq::WebApplication::QUEUE_NAME = T.let(T.unsafe(nil), Regexp)

# source://sidekiq//lib/sidekiq/web/application.rb#7
Sidekiq::WebApplication::REDIS_KEYS = T.let(T.unsafe(nil), Array)

# This is not a public API
#
# source://sidekiq//lib/sidekiq/web/helpers.rb#10
module Sidekiq::WebHelpers
  # This view helper provide ability display you html code in
  # to head of page. Example:
  #
  #   <% add_to_head do %>
  #     <link rel="stylesheet" .../>
  #     <meta .../>
  #   <% end %>
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#64
  def add_to_head; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#44
  def available_locales; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#32
  def clear_caches; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#240
  def csrf_tag; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#186
  def current_path; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#190
  def current_status; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#347
  def delete_or_add_queue(job, params); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#227
  def display_args(args, truncate_after_chars = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#69
  def display_custom_head; end

  # within is used by Sidekiq Pro
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#115
  def display_tags(job, within = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#316
  def environment_title_prefix; end

  # This is a hook for a Sidekiq Pro feature.  Please don't touch.
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#53
  def filtering(*_arg0); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#48
  def find_locale_files(lang); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#269
  def format_memory(rss_kb); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#126
  def get_locale; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#296
  def h(text); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#199
  def job_params(job, score); end

  # Given an Accept-Language header like "fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4,ru;q=0.2"
  # this method will try to best match the available locales to the user's preferred languages.
  #
  # Inspiration taken from https://github.com/iain/http_accept_language/blob/master/lib/http_accept_language/parser.rb
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#98
  def locale; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#38
  def locale_files; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#174
  def namespace; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#281
  def number_with_delimiter(number); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#203
  def parse_params(params); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#147
  def processes; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#322
  def product_version; end

  # Merge options with current params, filter safe params, and stringify to query string
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#211
  def qparams(options); end

  # Any paginated list that performs an action needs to redirect
  # back to the proper page after performing that action.
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#306
  def redirect_with_query(url); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#168
  def redis_connection; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#330
  def redis_connection_and_namespace; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#178
  def redis_info; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#194
  def relative_time(time); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#261
  def retry_extra_items(retry_job); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#337
  def retry_or_delete_or_kill(job, params); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#182
  def root_path; end

  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#77
  def rtl?; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#326
  def server_utc_time; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#24
  def singularize(str, count); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#139
  def sort_direction_label; end

  # Sorts processes by hostname following the natural sort order
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#152
  def sorted_processes; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#164
  def stats; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#11
  def strings(lang); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#130
  def t(msg, options = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#73
  def text_direction; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#244
  def to_display(arg); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#217
  def to_query_string(params); end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#223
  def truncate(text, truncate_after_chars = T.unsafe(nil)); end

  # mperham/sidekiq#3243
  #
  # @return [Boolean]
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#122
  def unfiltered?; end

  # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
  #
  # source://sidekiq//lib/sidekiq/web/helpers.rb#82
  def user_preferred_languages; end

  # source://sidekiq//lib/sidekiq/web/helpers.rb#143
  def workset; end
end

# source://sidekiq//lib/sidekiq/web/helpers.rb#254
Sidekiq::WebHelpers::RETRY_JOB_KEYS = T.let(T.unsafe(nil), Set)

# source://sidekiq//lib/sidekiq/web/helpers.rb#208
Sidekiq::WebHelpers::SAFE_QPARAMS = T.let(T.unsafe(nil), Array)

# source://sidekiq//lib/sidekiq/web/router.rb#69
class Sidekiq::WebRoute
  # @return [WebRoute] a new instance of WebRoute
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#74
  def initialize(request_method, pattern, block); end

  # Returns the value of attribute block.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def block; end

  # Sets the attribute block
  #
  # @param value the value to set the attribute block to.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def block=(_arg0); end

  # source://sidekiq//lib/sidekiq/web/router.rb#84
  def compile; end

  # source://sidekiq//lib/sidekiq/web/router.rb#94
  def match(request_method, path); end

  # source://sidekiq//lib/sidekiq/web/router.rb#80
  def matcher; end

  # Returns the value of attribute name.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def name; end

  # Sets the attribute name
  #
  # @param value the value to set the attribute name to.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def name=(_arg0); end

  # Returns the value of attribute pattern.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def pattern; end

  # Sets the attribute pattern
  #
  # @param value the value to set the attribute pattern to.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def pattern=(_arg0); end

  # Returns the value of attribute request_method.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def request_method; end

  # Sets the attribute request_method
  #
  # @param value the value to set the attribute request_method to.
  #
  # source://sidekiq//lib/sidekiq/web/router.rb#70
  def request_method=(_arg0); end
end

# source://sidekiq//lib/sidekiq/web/router.rb#72
Sidekiq::WebRoute::NAMED_SEGMENTS_PATTERN = T.let(T.unsafe(nil), Regexp)

# source://sidekiq//lib/sidekiq/web/router.rb#6
module Sidekiq::WebRouter
  # source://sidekiq//lib/sidekiq/web/router.rb#38
  def delete(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#22
  def get(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#18
  def head(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#48
  def match(env); end

  # source://sidekiq//lib/sidekiq/web/router.rb#34
  def patch(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#26
  def post(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#30
  def put(path, &block); end

  # source://sidekiq//lib/sidekiq/web/router.rb#42
  def route(method, path, &block); end
end

# source://sidekiq//lib/sidekiq/web/router.rb#8
Sidekiq::WebRouter::DELETE = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#7
Sidekiq::WebRouter::GET = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#12
Sidekiq::WebRouter::HEAD = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#11
Sidekiq::WebRouter::PATCH = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#16
Sidekiq::WebRouter::PATH_INFO = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#9
Sidekiq::WebRouter::POST = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#10
Sidekiq::WebRouter::PUT = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#15
Sidekiq::WebRouter::REQUEST_METHOD = T.let(T.unsafe(nil), String)

# source://sidekiq//lib/sidekiq/web/router.rb#14
Sidekiq::WebRouter::ROUTE_PARAMS = T.let(T.unsafe(nil), String)

# The WorkSet stores the work being done by this Sidekiq cluster.
# It tracks the process and thread working on each job.
#
# WARNING WARNING WARNING
#
# This is live data that can change every millisecond.
# If you call #size => 5 and then expect #each to be
# called 5 times, you're going to have a bad time.
#
#    works = Sidekiq::WorkSet.new
#    works.size => 2
#    works.each do |process_id, thread_id, work|
#      # process_id is a unique identifier per Sidekiq process
#      # thread_id is a unique identifier per thread
#      # work is a Hash which looks like:
#      # { 'queue' => name, 'run_at' => timestamp, 'payload' => job_hash }
#      # run_at is an epoch Integer.
#    end
#
# source://sidekiq//lib/sidekiq/api.rb#1101
class Sidekiq::WorkSet
  include ::Enumerable

  # source://sidekiq//lib/sidekiq/api.rb#1104
  def each(&block); end

  # Note that #size is only as accurate as Sidekiq's heartbeat,
  # which happens every 5 seconds.  It is NOT real-time.
  #
  # Not very efficient if you have lots of Sidekiq
  # processes but the alternative is a global counter
  # which can easily get out of sync with crashy processes.
  #
  # source://sidekiq//lib/sidekiq/api.rb#1140
  def size; end
end

# Include this module in your worker class and you can easily create
# asynchronous jobs:
#
#   class HardWorker
#     include Sidekiq::Worker
#     sidekiq_options queue: 'critical', retry: 5
#
#     def perform(*args)
#       # do some work
#     end
#   end
#
# Then in your Rails app, you can do this:
#
#   HardWorker.perform_async(1, 2, 3)
#
# Note that perform_async is a class method, perform is an instance method.
#
# Sidekiq::Worker also includes several APIs to provide compatibility with
# ActiveJob.
#
#   class SomeWorker
#     include Sidekiq::Worker
#     queue_as :critical
#
#     def perform(...)
#     end
#   end
#
#   SomeWorker.set(wait_until: 1.hour).perform_async(123)
#
# Note that arguments passed to the job must still obey Sidekiq's
# best practice for simple, JSON-native data types. Sidekiq will not
# implement ActiveJob's more complex argument serialization. For
# this reason, we don't implement `perform_later` as our call semantics
# are very different.
#
# source://sidekiq//lib/sidekiq/worker.rb#44
module Sidekiq::Worker
  include ::Sidekiq::Worker::Options

  mixes_in_class_methods ::Sidekiq::Worker::Options::ClassMethods
  mixes_in_class_methods ::Sidekiq::Worker::ClassMethods

  # Returns the value of attribute jid.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#156
  def jid; end

  # Sets the attribute jid
  #
  # @param value the value to set the attribute jid to.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#156
  def jid=(_arg0); end

  # source://sidekiq//lib/sidekiq/worker.rb#165
  def logger; end

  class << self
    # @private
    # @raise [ArgumentError]
    #
    # source://sidekiq//lib/sidekiq/worker.rb#158
    def included(base); end
  end
end

# source://sidekiq//lib/sidekiq/worker.rb#267
module Sidekiq::Worker::ClassMethods
  # source://sidekiq//lib/sidekiq/worker.rb#363
  def build_client; end

  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/worker.rb#358
  def client_push(item); end

  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/worker.rb#268
  def delay(*args); end

  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/worker.rb#272
  def delay_for(*args); end

  # @raise [ArgumentError]
  #
  # source://sidekiq//lib/sidekiq/worker.rb#276
  def delay_until(*args); end

  # source://sidekiq//lib/sidekiq/worker.rb#288
  def perform_async(*args); end

  # +interval+ must be a timestamp, numeric or something that acts
  #   numeric (like an activesupport time interval).
  #
  # source://sidekiq//lib/sidekiq/worker.rb#324
  def perform_at(interval, *args); end

  # Push a large number of jobs to Redis, while limiting the batch of
  # each job payload to 1,000. This method helps cut down on the number
  # of round trips to Redis, which can increase the performance of enqueueing
  # large numbers of jobs.
  #
  # +items+ must be an Array of Arrays.
  #
  # For finer-grained control, use `Sidekiq::Client.push_bulk` directly.
  #
  # Example (3 Redis round trips):
  #
  #     SomeWorker.perform_async(1)
  #     SomeWorker.perform_async(2)
  #     SomeWorker.perform_async(3)
  #
  # Would instead become (1 Redis round trip):
  #
  #     SomeWorker.perform_bulk([[1], [2], [3]])
  #
  # source://sidekiq//lib/sidekiq/worker.rb#318
  def perform_bulk(*args, **kwargs); end

  # +interval+ must be a timestamp, numeric or something that acts
  #   numeric (like an activesupport time interval).
  #
  # source://sidekiq//lib/sidekiq/worker.rb#324
  def perform_in(interval, *args); end

  # Inline execution of job's perform method after passing through Sidekiq.client_middleware and Sidekiq.server_middleware
  #
  # source://sidekiq//lib/sidekiq/worker.rb#293
  def perform_inline(*args); end

  # Inline execution of job's perform method after passing through Sidekiq.client_middleware and Sidekiq.server_middleware
  #
  # source://sidekiq//lib/sidekiq/worker.rb#293
  def perform_sync(*args); end

  # source://sidekiq//lib/sidekiq/worker.rb#280
  def queue_as(q); end

  # source://sidekiq//lib/sidekiq/worker.rb#284
  def set(options); end

  # Allows customization for this type of Worker.
  # Legal options:
  #
  #   queue - use a named queue for this Worker, default 'default'
  #   retry - enable retries via JobRetry, *true* to use the default
  #      or *Integer* count
  #   backtrace - whether to save any error backtrace in the retry payload to display in web UI,
  #      can be true, false or an integer number of lines to save, default *false*
  #   pool - use the given Redis connection pool to push this type of job to a given shard.
  #
  # In practice, any option is allowed.  This is the main mechanism to configure the
  # options for a specific job.
  #
  # These options will be saved into the serialized job when enqueued by
  # the client.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#354
  def sidekiq_options(opts = T.unsafe(nil)); end
end

# The Options module is extracted so we can include it in ActiveJob::Base
# and allow native AJs to configure Sidekiq features/internals.
#
# source://sidekiq//lib/sidekiq/worker.rb#48
module Sidekiq::Worker::Options
  mixes_in_class_methods ::Sidekiq::Worker::Options::ClassMethods

  class << self
    # @private
    #
    # source://sidekiq//lib/sidekiq/worker.rb#49
    def included(base); end
  end
end

# source://sidekiq//lib/sidekiq/worker.rb#56
module Sidekiq::Worker::Options::ClassMethods
  # source://sidekiq//lib/sidekiq/worker.rb#84
  def get_sidekiq_options; end

  # source://sidekiq//lib/sidekiq/worker.rb#88
  def sidekiq_class_attribute(*attrs); end

  # Allows customization for this type of Worker.
  # Legal options:
  #
  #   queue - name of queue to use for this job type, default *default*
  #   retry - enable retries for this Worker in case of error during execution,
  #      *true* to use the default or *Integer* count
  #   backtrace - whether to save any error backtrace in the retry payload to display in web UI,
  #      can be true, false or an integer number of lines to save, default *false*
  #
  # In practice, any option is allowed.  This is the main mechanism to configure the
  # options for a specific job.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#71
  def sidekiq_options(opts = T.unsafe(nil)); end

  # source://sidekiq//lib/sidekiq/worker.rb#80
  def sidekiq_retries_exhausted(&block); end

  # source://sidekiq//lib/sidekiq/worker.rb#76
  def sidekiq_retry_in(&block); end
end

# source://sidekiq//lib/sidekiq/worker.rb#57
Sidekiq::Worker::Options::ClassMethods::ACCESSOR_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)

# This helper class encapsulates the set options for `set`, e.g.
#
#     SomeWorker.set(queue: 'foo').perform_async(....)
#
# source://sidekiq//lib/sidekiq/worker.rb#173
class Sidekiq::Worker::Setter
  include ::Sidekiq::JobUtil

  # @return [Setter] a new instance of Setter
  #
  # source://sidekiq//lib/sidekiq/worker.rb#176
  def initialize(klass, opts); end

  # source://sidekiq//lib/sidekiq/worker.rb#194
  def perform_async(*args); end

  # +interval+ must be a timestamp, numeric or something that acts
  #   numeric (like an activesupport time interval).
  #
  # source://sidekiq//lib/sidekiq/worker.rb#250
  def perform_at(interval, *args); end

  # source://sidekiq//lib/sidekiq/worker.rb#239
  def perform_bulk(args, batch_size: T.unsafe(nil)); end

  # +interval+ must be a timestamp, numeric or something that acts
  #   numeric (like an activesupport time interval).
  #
  # source://sidekiq//lib/sidekiq/worker.rb#250
  def perform_in(interval, *args); end

  # Explicit inline execution of a job. Returns nil if the job did not
  # execute, true otherwise.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#204
  def perform_inline(*args); end

  # Explicit inline execution of a job. Returns nil if the job did not
  # execute, true otherwise.
  #
  # source://sidekiq//lib/sidekiq/worker.rb#204
  def perform_sync(*args); end

  # source://sidekiq//lib/sidekiq/worker.rb#186
  def set(options); end

  private

  # source://sidekiq//lib/sidekiq/worker.rb#257
  def at(interval); end
end

# Since "worker" is a nebulous term, we've deprecated the use of this class name.
# Is "worker" a process, a type of job, a thread? Undefined!
# WorkSet better describes the data.
#
# source://sidekiq//lib/sidekiq/api.rb#1158
Sidekiq::Workers = Sidekiq::WorkSet