<commit_before>= dalliance

Background processing for ActiveRecord w/ a 'delayable' worker & a state_machine

Built in support for delayed_job or resque.

== Getting Started

In your Gemfile:

    gem "dalliance"

In your model:

    class Model < ActiveRecord::Base
      dalliance :process_method
    end

process_method is the name of the method to invoke for background processing
to kick it off just call dalliance_background_process

Handle your migrations:

   rails g dalliance:progress_meter

   rails g dalliance:update model_name

== ProgressMeter

Create a method called dalliance_progress_meter_total_count
(or provide the dalliance_progress_meter_total_count_method option)

Inside process_method call dalliance_progress_meter.increment! after each iteration<commit_msg>Update README with reprocessing information<commit_after>= dalliance

Background processing for ActiveRecord w/ a 'delayable' worker & a state_machine

Built in support for delayed_job or resque.

== Getting Started

In your Gemfile:

    gem "dalliance"

In your model:

    class Model < ActiveRecord::Base
      dalliance :process_method
    end

process_method is the name of the method to invoke for background processing
to kick it off just call dalliance_background_process

Models can also be re-processed to allow front-end users to reprocess without
needing to loop in PMs or developers:

    class Model < ActiveRecord::Base
      dalliance :process_method,
                dalliance_reprocess_method: :reprocessing_method
    end

Keep in mind that a record that has not already been completely processed (eg in
a state of 'pending' or 'processing') cannot be reprocessed. Attempting to
reprocess the record will raise an error.

== Handle your migrations:

   rails g dalliance:progress_meter

   rails g dalliance:update model_name

== ProgressMeter

Create a method called dalliance_progress_meter_total_count
(or provide the dalliance_progress_meter_total_count_method option)

Inside process_method call dalliance_progress_meter.increment! after each iteration
{'fraction_non_alphanumeric': 0.036875303250849104, 'fraction_numerical': 0.0, 'mean_word_length': 4.792134831460674, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3454181', 'n_tokens_mistral': 562, 'n_tokens_neox': 554, 'n_words': 228}