From 09b49c26ddfdb20ced61e7dfd4192e750ce40449 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 31 Jul 2017 08:15:23 -0700 Subject: PLT-5308 Caching layer part 2 (#6973) * Adding Reaction store cache layer example * Implementing reaction store in new caching system. * Redis for reaction store * Adding redis library * Adding invalidation for DeleteAllWithEmojiName and other minor enhancements --- vendor/github.com/go-redis/redis/redis_context.go | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 vendor/github.com/go-redis/redis/redis_context.go (limited to 'vendor/github.com/go-redis/redis/redis_context.go') diff --git a/vendor/github.com/go-redis/redis/redis_context.go b/vendor/github.com/go-redis/redis/redis_context.go new file mode 100644 index 000000000..6ec811ca5 --- /dev/null +++ b/vendor/github.com/go-redis/redis/redis_context.go @@ -0,0 +1,35 @@ +// +build go1.7 + +package redis + +import ( + "context" + + "github.com/go-redis/redis/internal/pool" +) + +type baseClient struct { + connPool pool.Pooler + opt *Options + + process func(Cmder) error + onClose func() error // hook called when client is closed + + ctx context.Context +} + +func (c *Client) Context() context.Context { + if c.ctx != nil { + return c.ctx + } + return context.Background() +} + +func (c *Client) WithContext(ctx context.Context) *Client { + if ctx == nil { + panic("nil context") + } + c2 := c.copy() + c2.ctx = ctx + return c2 +} -- cgit v1.2.3-1-g7c22