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

[5.6] Redis Connection Contract #24142

Merged
merged 3 commits into from May 8, 2018

Conversation

Projects
None yet
3 participants
@hskrasek
Contributor

hskrasek commented May 8, 2018

This pull request aims to tackle laravel/ideas#399, but re-targeted to Laravel 5.6.

With this pull request we will gain a new Redis Connection interface, allowing developers to type hint against the interface instead of either A) hard coding to a specific connection type or B) not type hinting the connection parameter.

Currently Proposed Interface:

<?php

namespace Illuminate\Redis\Connections;

use Closure;

interface ConnectionInterface
{
    /**
     * Subscribe to a set of given channels for messages.
     *
     * @param  array|string  $channels
     * @param  \Closure  $callback
     * @return void
     */
    public function subscribe($channels, Closure $callback);

    /**
     * Subscribe to a set of given channels with wildcards.
     *
     * @param  array|string  $channels
     * @param  \Closure  $callback
     * @return void
     */
    public function psubscribe($channels, Closure $callback);

    /**
     * Run a command against the Redis database.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    public function command($method, array $parameters = []);
}

hskrasek added some commits May 8, 2018

Add a new interfact for redis connections
Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
Update PhpRedisConnection and PredisConnection to implement the new
Connection contract

Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
StyleCI adjustment
Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
@tillkruss

This comment has been minimized.

Member

tillkruss commented May 8, 2018

Can you please send this to 5.7 to avoid breaking changes, just in case?

@taylorotwell taylorotwell merged commit 06abbde into laravel:5.6 May 8, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment