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

[5.6] Redis Connection Contract #24142

Merged

Conversation

hskrasek
Copy link
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 = []);
}

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
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