forked from mirror/redis
commit
6ff343b69f
12
commands.go
12
commands.go
|
@ -2075,6 +2075,18 @@ func (c *cmdable) ClientID() *IntCmd {
|
|||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) ClientUnblock(id int64) *IntCmd {
|
||||
cmd := NewIntCmd("client", "unblock", id)
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c *cmdable) ClientUnblockWithError(id int64) *IntCmd {
|
||||
cmd := NewIntCmd("client", "unblock", id, "error")
|
||||
c.process(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
// ClientSetName assigns a name to the connection.
|
||||
func (c *statefulCmdable) ClientSetName(name string) *BoolCmd {
|
||||
cmd := NewBoolCmd("client", "setname", name)
|
||||
|
|
|
@ -127,6 +127,20 @@ var _ = Describe("Commands", func() {
|
|||
Expect(client.ClientID().Val()).To(BeNumerically(">=", 0))
|
||||
})
|
||||
|
||||
It("should ClientUnblock", func() {
|
||||
id := client.ClientID().Val()
|
||||
r, err := client.ClientUnblock(id).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(r).To(Equal(int64(0)))
|
||||
})
|
||||
|
||||
It("should ClientUnblockWithError", func() {
|
||||
id := client.ClientID().Val()
|
||||
r, err := client.ClientUnblockWithError(id).Result()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(r).To(Equal(int64(0)))
|
||||
})
|
||||
|
||||
It("should ClientPause", func() {
|
||||
err := client.ClientPause(time.Second).Err()
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
|
Loading…
Reference in New Issue