Skip to content

Commit

Permalink
Further clarify #20
Browse files Browse the repository at this point in the history
  • Loading branch information
mhenrixon committed Jan 27, 2014
1 parent b77f6a5 commit fc386fa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ Requiring the gem in your gemfile should be sufficient to enable unique jobs.

### Finer Control over Uniqueness

Sometimes it is desired to have a finer control over which arguments are used in determining uniqueness of the job, and others may be _transient_. For this use-case, you need to
set `SidekiqUniqueJobs::Config.unique_args_enabled` to true in an initializer, and then defined either `unique_args` method, or a ruby proc.
Sometimes it is desired to have a finer control over which arguments are used in determining uniqueness of the job, and others may be _transient_. For this use-case, you need to set `SidekiqUniqueJobs::Config.unique_args_enabled` to true in an initializer, and then defined either `unique_args` method, or a ruby proc.

The unique_args method need to return an array of values to use for uniqueness check.

```ruby
SidekiqUniqueJobs::Config.unique_args_enabled = true
Expand Down Expand Up @@ -74,10 +75,7 @@ class UniqueJobWithFilterProc
end
```

Note that objects passed into workers are converted to JSON *after* running through client middleware. In server
middleware, the JSON is passed directly to the worker `#perform` method. So, you may run into issues where the
arguments are different when enqueuing than they are when performing. Your `unique_args` method may need to
account for this.
Note that objects passed into workers are converted to JSON *after* running through client middleware. In server middleware, the JSON is passed directly to the worker `#perform` method. So, you may run into issues where the arguments are different when enqueuing than they are when performing. Your `unique_args` method may need to account for this.

### Unlock Ordering

Expand Down

0 comments on commit fc386fa

Please sign in to comment.