blob: 74a8832954ddcf714c9bfd7b995dafa415bbb237 [file] [log] [blame]
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02001<?php
2
3namespace Illuminate\Contracts\Redis;
4
5use Closure;
6
7interface Connection
8{
9 /**
10 * Subscribe to a set of given channels for messages.
11 *
12 * @param array|string $channels
13 * @param \Closure $callback
14 * @return void
15 */
16 public function subscribe($channels, Closure $callback);
17
18 /**
19 * Subscribe to a set of given channels with wildcards.
20 *
21 * @param array|string $channels
22 * @param \Closure $callback
23 * @return void
24 */
25 public function psubscribe($channels, Closure $callback);
26
27 /**
28 * Run a command against the Redis database.
29 *
30 * @param string $method
31 * @param array $parameters
32 * @return mixed
33 */
34 public function command($method, array $parameters = []);
35}