mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
switch from rdoc to yard
This commit is contained in:
parent
4508477bf5
commit
16b51f3961
3 changed files with 40 additions and 9 deletions
13
Rakefile
13
Rakefile
|
@ -1,15 +1,18 @@
|
||||||
require "bundler/gem_tasks"
|
require "bundler/gem_tasks"
|
||||||
require "rake/testtask"
|
require "rake/testtask"
|
||||||
require "standard/rake"
|
require "standard/rake"
|
||||||
require "rdoc/task"
|
require "yard"
|
||||||
|
require "yard/rake/yardoc_task"
|
||||||
|
|
||||||
RDoc::Task.new do |rdoc|
|
YARD::Rake::YardocTask.new do |yard|
|
||||||
rdoc.main = "docs/rdoc.rdoc"
|
yard.files = [
|
||||||
rdoc.rdoc_files.include("docs/rdoc.rdoc",
|
|
||||||
"lib/sidekiq/api.rb",
|
"lib/sidekiq/api.rb",
|
||||||
"lib/sidekiq/client.rb",
|
"lib/sidekiq/client.rb",
|
||||||
"lib/sidekiq/worker.rb",
|
"lib/sidekiq/worker.rb",
|
||||||
"lib/sidekiq/job.rb")
|
# "lib/sidekiq/job.rb",
|
||||||
|
"-",
|
||||||
|
"Changes.md",
|
||||||
|
"docs/menu.md"]
|
||||||
end
|
end
|
||||||
|
|
||||||
Rake::TestTask.new(:test) do |test|
|
Rake::TestTask.new(:test) do |test|
|
||||||
|
|
29
docs/menu.md
Normal file
29
docs/menu.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Sidekiq public API documentation
|
||||||
|
|
||||||
|
Sidekiq provides a number of public APIs for various functionality.
|
||||||
|
|
||||||
|
1. Middleware
|
||||||
|
2. Lifecycle Events
|
||||||
|
3. Data API
|
||||||
|
4. Components
|
||||||
|
|
||||||
|
## Middleware
|
||||||
|
|
||||||
|
Middleware run around the the client-side push and the server-side execution of jobs. This allows plugins which mutate job data or provide additional functionality during the executiong of specific jobs.
|
||||||
|
|
||||||
|
## Lifecycle Events
|
||||||
|
|
||||||
|
With lifecycle events, Sidekiq plugins can register a callback upon `startup`, `quiet` or `shutdown`.
|
||||||
|
This is useful for starting and stopping your own Threads or services within the Sidekiq process.
|
||||||
|
|
||||||
|
## Data API
|
||||||
|
|
||||||
|
The code in `sidekiq/api` provides a Ruby facade on top of Sidekiq's persistent data within Redis.
|
||||||
|
It contains many classes and methods for discovering, searching and iterating through the real-time job data within the queues and sets inside Redis.
|
||||||
|
This API powers the Sidekiq::Web UI.
|
||||||
|
|
||||||
|
## Components (ALPHA)
|
||||||
|
|
||||||
|
Coming in Sidekiq 7.0, Components are elements of code which run inside each Sidekiq process.
|
||||||
|
They are passed a handle to the Sidekiq container which gives them direct access
|
||||||
|
to resources like the Logger, Redis connection pool and other registered resources.
|
|
@ -517,7 +517,7 @@ module Sidekiq
|
||||||
|
|
||||||
# Change the scheduled time for this job.
|
# Change the scheduled time for this job.
|
||||||
#
|
#
|
||||||
# @param [Time] the new timestamp for this job
|
# @param at [Time] the new timestamp for this job
|
||||||
def reschedule(at)
|
def reschedule(at)
|
||||||
Sidekiq.redis do |conn|
|
Sidekiq.redis do |conn|
|
||||||
conn.zincrby(@parent.name, at.to_f - @score, Sidekiq.dump_json(@item))
|
conn.zincrby(@parent.name, at.to_f - @score, Sidekiq.dump_json(@item))
|
||||||
|
@ -678,8 +678,7 @@ module Sidekiq
|
||||||
# Fetch jobs that match a given time or Range. Job ID is an
|
# Fetch jobs that match a given time or Range. Job ID is an
|
||||||
# optional second argument.
|
# optional second argument.
|
||||||
#
|
#
|
||||||
# @param score [Time] a specific timestamp
|
# @param score [Time,Range] a specific timestamp or range
|
||||||
# @param score [Range] a timestamp range
|
|
||||||
# @param jid [String, optional] find a specific JID within the score
|
# @param jid [String, optional] find a specific JID within the score
|
||||||
# @return [Array<SortedEntry>] any results found, can be empty
|
# @return [Array<SortedEntry>] any results found, can be empty
|
||||||
def fetch(score, jid = nil)
|
def fetch(score, jid = nil)
|
||||||
|
@ -706,7 +705,7 @@ module Sidekiq
|
||||||
# *This is a slow O(n) operation*. Do not use for app logic.
|
# *This is a slow O(n) operation*. Do not use for app logic.
|
||||||
#
|
#
|
||||||
# @param jid [String] the job identifier
|
# @param jid [String] the job identifier
|
||||||
# @returns [SortedEntry] the record or nil
|
# @return [SortedEntry] the record or nil
|
||||||
def find_job(jid)
|
def find_job(jid)
|
||||||
Sidekiq.redis do |conn|
|
Sidekiq.redis do |conn|
|
||||||
conn.zscan_each(name, match: "*#{jid}*", count: 100) do |entry, score|
|
conn.zscan_each(name, match: "*#{jid}*", count: 100) do |entry, score|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue