From 08ae2d0555fe40e124639f423c9ae7f5e0458932 Mon Sep 17 00:00:00 2001 From: Sudhir Jonathan Date: Thu, 14 Dec 2017 22:06:57 +0530 Subject: [PATCH] Added subscription interfaces to universal client --- commands.go | 5 +++++ universal.go | 1 + 2 files changed, 6 insertions(+) diff --git a/commands.go b/commands.go index aa98aa73..d6e6f2a5 100644 --- a/commands.go +++ b/commands.go @@ -257,6 +257,11 @@ type StatefulCmdable interface { ReadWrite() *StatusCmd } +type Subscribable interface { + Subscribe(channels ...string) *PubSub + PSubscribe(channels ...string) *PubSub +} + var _ Cmdable = (*Client)(nil) var _ Cmdable = (*Tx)(nil) var _ Cmdable = (*Ring)(nil) diff --git a/universal.go b/universal.go index 29eb12b1..339bb4e1 100644 --- a/universal.go +++ b/universal.go @@ -113,6 +113,7 @@ func (o *UniversalOptions) simple() *Options { // applications locally. type UniversalClient interface { Cmdable + Subscribable Process(cmd Cmder) error Close() error }