mperham/sidekiq — comment on commit a093e29a9a26288591ee9d3033101f5f1593575f
File:  line 0
By ryanlecompte:

Hey Mike,

I was able to put together an initial implementation of breaking out the
middleware support to client and server layers. Please take a look at the
latest commit on the topic branch and let me know your thoughts. Basically,
I refactored middleware.rb into client/server layers and made the Chain
class something that can be instantiated and re-used as opposed to a single
static instance like we currently have.

Commit here:
https://github.com/mperham/sidekiq/compare/a093e29a9a...8bf25385d2

New middleware can easily be added to the client-side with (by default
there is no middleware unless you configure ignore duplicate messages flag):

```ruby
Sidekiq::Client.middleware.register do
...
end
```
and to the server-side with:

```ruby
Sidekiq::Processor.middleware.register do
...
end
```

Let me know if you think this is a good direction ...

Thanks,
Ryan

On Wed, Feb 8, 2012 at 11:50 AM, Ryan LeCompte wrote:

> Hey Mike,
>
> I have all of these changes already in my local sandbox, I just haven't
> uploaded them to the repo yet. I'll do it later tonight for sure, including
> the deisgn change for client-side middleware.
>
> Thanks!
>
> Ryan
>
>
> On Wed, Feb 8, 2012 at 11:44 AM, Mike Perham <
> reply@reply.github.com
> > wrote:
>
>> A couple of points:
>> 1) It looks like you're still doing set operations, not top-level hash
>> operations.
>> 2) The client shouldn't do any of the MD5 work if ignore_duplicate_jobs?
>> is false.
>> 3) We'll need to refactor this into client-side middleware. If you want
>> to take a stab at the design and implementation, feel free. I'll try to
>> find some time over the next few days to work on it.
>>
>> ---
>> Reply to this email directly or view it on GitHub:
>>
>> https://github.com/mperham/sidekiq/commit/a093e29a9a26288591ee9d3033101f5f1593575f#commitcomment-946634
>>
>
>