Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Redis#queue, Redis#commit and Redis#pipelined without block. #1059

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

casperisfine
Copy link

@casperisfine casperisfine commented Jan 20, 2022

All theses make a lot of assumptions on the threading model and are barely thread safe.

The new favored API is:

redis.pipelined do |pipeline|
  pipeline.get("foo")
  pipeline.del("bar")
end

This API allow multiple threads to build pipelines concurrently on the same connection, and is more friendly to Fiber based concurrency.

Fix: #1057

The same should be applied to Redis#multi, and we might want to add an easy way to turn off deprecation warnings.

FYI: @machty

… block.

All theses make a lot of assumptions on the threading model and are barely
thread safe.

The new favored API is:

```ruby
redis.pipelined do |pipeline|
  pipeline.get("foo")
  pipeline.del("bar")
end
```

This API allow multiple threads to build pipelines concurrently on the same
connection, and is more friendly to Fiber based concurrency.

Fix: redis#1057
@casperisfine casperisfine marked this pull request as ready for review January 20, 2022 13:07
@byroot byroot merged commit 7a3159a into redis:master Jan 20, 2022
casperisfine pushed a commit to casperisfine/progressrus that referenced this pull request Jan 24, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/sidekiq that referenced this pull request Jan 24, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/sidekiq that referenced this pull request Jan 24, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
mperham pushed a commit to sidekiq/sidekiq that referenced this pull request Jan 24, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
casperisfine pushed a commit to casperisfine/redis-store that referenced this pull request Jan 24, 2022
The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/redis-store that referenced this pull request Jan 24, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to Shopify/rack-mini-profiler that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/resque-scheduler that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/sidekiq-scheduler that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
casperisfine pushed a commit to casperisfine/flipper that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.
casperisfine pushed a commit to casperisfine/coverband that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.
casperisfine pushed a commit to casperisfine/stoplight that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.
casperisfine pushed a commit to casperisfine/flipper that referenced this pull request Jan 25, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.
iloveitaly pushed a commit to resque/resque-scheduler that referenced this pull request Jan 26, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
marcelolx pushed a commit to sidekiq-scheduler/sidekiq-scheduler that referenced this pull request Jan 28, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
ixti added a commit to ixti/rack-attack that referenced this pull request Feb 4, 2022
Redis 4.6.0 deprecated calling commands on `Redis` inside `#pipelined`:

    redis.pipelined do
      redis.get("key")
    end

The above should be:

    redis.pipelined do |pipeline|
      pipeline.get("key")
    end

See: redis/redis-rb#1059
OsamaSayegh pushed a commit to MiniProfiler/rack-mini-profiler that referenced this pull request Feb 10, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
rsanheim added a commit to simpledotorg/simple-server that referenced this pull request Feb 11, 2022
bolshakov pushed a commit to bolshakov/stoplight that referenced this pull request Feb 23, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
This API is available since Redis 3.0.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
@Envek
Copy link

Envek commented Mar 10, 2022

In which version this “favored API” with block param was introduced?

The new favored API is:

redis.pipelined do |pipeline|

This is required to properly constrain redis gem versions in dependent gems and applications. Thanks.

@casperisfine
Copy link
Author

In 3.0.0.

marcelolx pushed a commit to sidekiq-scheduler/sidekiq-scheduler that referenced this pull request Mar 21, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.
johnsyweb added a commit to johnsyweb/fresh_redis that referenced this pull request Apr 29, 2022
The version without the block causes exccessive logging since redis/redis-rb#1059
@yorozen
Copy link

yorozen commented May 18, 2022

Hi,
Not fully understood, the API usage was changed in 4.6.0, but we can still use the old method.
In 5.0.0 the old usage will be blocked?

nevans added a commit to nevans/resque that referenced this pull request Jun 21, 2022
Re-using the connection is no longer supported.  Instead, the block var
must be used.

See also:
* redis/redis-rb#1059
* resque/redis-namespace#192
iloveitaly pushed a commit to resque/resque that referenced this pull request Jun 22, 2022
Re-using the connection is no longer supported.  Instead, the block var
must be used.

See also:
* redis/redis-rb#1059
* resque/redis-namespace#192
jwoodrow pushed a commit to moonproject/resque that referenced this pull request Aug 5, 2022
Re-using the connection is no longer supported.  Instead, the block var
must be used.

See also:
* redis/redis-rb#1059
* resque/redis-namespace#192
dalpo added a commit to dalpo/sidekiq-scheduler that referenced this pull request Dec 19, 2022
Context: redis/redis-rb#1059

The following is deprecated
```ruby
redis.pipelined do
  redis.get(key)
end
```

And should be rewritten as:
```ruby
redis.pipelined do |pipeline|
  pipeline.get(key)
end
```

Functionally it makes no difference.

Original commit: sidekiq-scheduler@041d2b5
jlledom added a commit to jlledom/apisonator that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants