Skip to content

[5.6] Redis Connection Contract#24142

Merged
taylorotwell merged 3 commits intolaravel:5.6from
hskrasek:feature/redis-connection-contract
May 8, 2018
Merged

[5.6] Redis Connection Contract#24142
taylorotwell merged 3 commits intolaravel:5.6from
hskrasek:feature/redis-connection-contract

Conversation

@hskrasek
Copy link
Copy Markdown
Contributor

@hskrasek 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 3 commits May 7, 2018 22:04
Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
Connection contract

Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
Signed-off-by: Hunter Skrasek <hunterskrasek@me.com>
@tillkruss
Copy link
Copy Markdown
Contributor

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

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.

3 participants