<commit_before># sqeduler

## Description

Provides common infrastructure for Sidekiq and highly available scheduling across multiple hosts.

## Features

* Centralizes configuration for Sidekiq and Sidekiq::Scheduler
* Provides helpul modules for Sidekiq jobs.
  * Simple callbacks for `before_start`, `on_success`, `on_failure`
  * Synchronization across multiple hosts:
    * Provides global level scheduler locks through a thread-safe redis lock
    * `synchronize_jobs_mode` for if a job should run exclusively. Currently only supports `:one_at_a_time`.
    * Callbacks for `on_schedule_collision` and `on_lock_timeout`
  * Crosshost worker killswitches. `enabled` and `disable` methods to enable and disable workers. Enabled by default.

## Examples

To install this gem with necessary forks:

```ruby
gem 'sqeduler'
gem 'sidekiq-scheduler', :github => 'ecin/sidekiq-scheduler', :branch => 'ecin/redis-lock' # https://github.com/Moove-it/sidekiq-scheduler/pull/38
```

### Scheduling

To use this gem for initializing `Sidekiq` and `Sidekiq::Scheduler`:

In an initializer:
```ruby
require 'sqeduler'
config = Sqeduler::Config.new(
  # configuration for connecting to redis client. Must be a hash, not a `ConnectionPool`.
  :redis_hash => SIDEKIQ_REDIS,
  :logger     => logger, # defaults to Rails.logger if nil
)

# OPTIONAL PARAMETERS
# Additional configuration for Sidekiq.
# Optional server config for sidekiq. Allows you to hook into `Sidekiq.configure_server`<commit_msg>Fix docs markdown<commit_after># sqeduler

## Description

Provides common infrastructure for Sidekiq and highly available scheduling across multiple hosts.

## Features

* Centralizes configuration for Sidekiq and Sidekiq::Scheduler
* Provides helpul modules for Sidekiq jobs.
  * Simple callbacks for `before_start`, `on_success`, `on_failure`
  * Synchronization across multiple hosts:
    * Provides global level scheduler locks through a thread-safe redis lock
    * `synchronize_jobs_mode` for if a job should run exclusively. Currently only supports `:one_at_a_time`.
    * Callbacks for `on_schedule_collision` and `on_lock_timeout`
  * Crosshost worker killswitches. `enabled` and `disable` methods to enable and disable workers. Enabled by default.

## Examples

To install this gem with necessary forks:

```ruby
gem 'sqeduler'
gem 'sidekiq-scheduler', :github => 'ecin/sidekiq-scheduler', :branch => 'ecin/redis-lock' # https://github.com/Moove-it/sidekiq-scheduler/pull/38
```

### Scheduling

To use this gem for initializing `Sidekiq` and `Sidekiq::Scheduler`:

In an initializer:

```ruby
require 'sqeduler'
config = Sqeduler::Config.new(
  # configuration for connecting to redis client. Must be a hash, not a `ConnectionPool`.
  :redis_hash => SIDEKIQ_REDIS,
  :logger     => logger, # defaults to Rails.logger if nil
)

# OPTIONAL PARAMETERS
# Additional configuration for Sidekiq.
# Optional server config for sidekiq. Allows you to hook into `Sidekiq.configure_server`
{'fraction_non_alphanumeric': 0.09081735620585267, 'fraction_numerical': 0.0013454423141607804, 'mean_word_length': 4.971887550200803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1389933', 'n_tokens_mistral': 922, 'n_tokens_neox': 894, 'n_words': 311}