Closed buzzdan closed 5 years ago
When using multi each command returns the string "QUEUED" exec returns the values of the executed commands how do i fetch that value in the client ?
for example for this code:
multi := tx.TxPipeline() cmd := multi.RPushX(key, ".") cmds, err := multi.Exec()
i try to use those mocks:
srv.HandleFunc("multi", func(w resp.ResponseWriter, c *resp.Command) { w.AppendOK() }) srv.Handle("rpushx", redeo.WrapperFunc(func(c *resp.Command) interface{} { return "QUEUED" })) srv.Handle("exec", redeo.WrapperFunc(func(c *resp.Command) interface{} { return []int{1} }))
how can i get the value 1 ? i tried:
c := cmd.Val() // returns 0
or:
count = cmds[0].(*redis.IntCmd).Val() //returns 0 too
Thanks Dan
my bad, cmd.Val() returns 1 sorry for that!
When using multi each command returns the string "QUEUED" exec returns the values of the executed commands how do i fetch that value in the client ?
for example for this code:
i try to use those mocks:
how can i get the value 1 ? i tried:
c := cmd.Val() // returns 0
or:
count = cmds[0].(*redis.IntCmd).Val() //returns 0 too
Thanks Dan