Skip to content

Non block version of multi #129

@hugopl

Description

@hugopl

Hi,

I need to start transaction for more than one redis server and write the same set of keys for all them in this transaction. With current multi this isn't possible since it requires a block. But I can't just call:

@redis_clients.each do |redis|
  redis.multi do |multi|
    write_keys(multi)
  end
end

Since the write_keys procedure is slow and memory hungry. The solution is to just send the MULTI/EXEC command myself, but I was thinking if a patch to allow a non-blocking version of multi would be acceptable.

The only implementation issue I foresee is how to restore the Redis::Strategy::SingleStatement to the Redis object without make everything coupled.... another option would be to not change the @strategy when using non-blocking multi...

I can create a patch for this once is decided what is acceptable and what isn't, so I don't waste my time nether time of others 😉 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions