Skip to content

Commit

Permalink
add more notes about pseudo-code example for background processing
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed Jun 18, 2015
1 parent 926df57 commit 4183807
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ class ExpensiveCalculation

initialize :leader, :members

def send_to_background
background_arguments = initializer_arguments.merge(trigger: :do_expensive_calculation)
def send_to_background(trigger_method)
background_arguments = initializer_arguments.merge(trigger: trigger_method)
BackgroundProcessor.enqueue(self.class.name, **background_arguments)
end

Expand All @@ -671,8 +671,11 @@ class ExpensiveCalculation
end
end
end
ExpensiveCalculation.new(some_object, some_collection).send_to_background(:do_expensive_calculation)
```

The above example is merely pseudo-code to show how `initializer_arguments` can be used. Customize it according to your own needs.

## Overview in code

Here's a view of the possibilities in code.
Expand Down

0 comments on commit 4183807

Please sign in to comment.