Comments (6)
I don't see why it wouldn't work. Did you try?
from miniredis.
Yes, but I could not mock the pipeline/exec methods. I think I'll just mock the return from it and test.
Thanks
from miniredis.
The pipeline seems only a client side optimization (to minimize network packets), and so I don't see how it shouldn't work as-is. Hmmm, weird.
from miniredis.
Aha, I get a runtime panic. Thanks for reporting :) Need some coffee, it works.
from miniredis.
this is what I used, which works fine for me, @otaviojacobi:
package main
import (
"fmt"
"github.com/alicebob/miniredis"
"github.com/go-redis/redis"
)
func main() {
s := miniredis.NewMiniRedis()
s.Start()
c := redis.NewClient(&redis.Options{Addr: s.Addr()})
pipe := c.Pipeline()
pipe.IncrBy("foo", 42)
pipe.Get("foo")
results, err := pipe.Exec()
fmt.Printf("%v %s\n", results, err)
}
from miniredis.
Oh, nice ! I actually didn't run into the runtime panic, but I could use what you pointed out !
Many thanks !
from miniredis.
Related Issues (20)
- expire time invalid HOT 5
- RESP3 Issues HOT 9
- Wrong behavior with SET NX GET HOT 4
- how can i know the miniredis was close HOT 2
- MEMORY USAGE command HOT 2
- Special lastId=$ not working with XREAD HOT 2
- Blocking calls from lua always deadlock HOT 4
- Discrepancy with LSET after copying a list HOT 2
- redis: can't parse array/set/push HOT 6
- not support mock err HOT 1
- Slow SPOP command due to re-sorting HOT 2
- Last release v2.30.5 has incorrect tag HOT 1
- Last release v2.30.5 has incorrect tag HOT 3
- Feature Request: `CLIENT` Command Not Supported HOT 2
- Using embedded subscribe and external client leads to io timeout HOT 5
- Feature Request: ZINTER command HOT 2
- GEOSEARCH support
- Support for checking lack of hash tag in redis cluster mode
- Ignore `redis.set_repl` in miniredis
- Allow redis server to connect on specified Port number instead of Random Port HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniredis.