-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equivalent of pipeline feature in 0.5.x #173
Comments
Hey, Olric still supports pipelining at the protocol level. I'm going to bring back that feature soon, but I'm not sure how it should be implemented in the API.
BTW, only a subset of the API can support pipelining. For example, the Lock commands should not be supported. It may look like this: cmds, err := rdb.Pipelined(ctx, func(pipe redis.Pipeliner) error {
for i := 0; i < 100; i++ {
pipe.Get(ctx, fmt.Sprintf("key%d", i))
}
return nil
})
if err != nil {
panic(err)
}
for _, cmd := range cmds {
fmt.Println(cmd.(*redis.StringCmd).Val())
} |
Hey @hasit I prepared the new version of pipelining. It only supports a subset of the DMap methods:
You can find the initial implementation here: https://github.com/buraksezer/olric/blob/feature/resp-pipelining/pipeline.go Here is an example: func ExamplePipeline() {
c, err := NewClusterClient([]string{"127.0.0.1:3320"})
if err != nil {
// Handle this error
}
dm, err := c.NewDMap("mydmap")
if err != nil {
// Handle this error
}
ctx := context.Background()
pipe, err := dm.Pipeline()
if err != nil {
// Handle this error
}
futurePut, err := pipe.Put(ctx, "key-1", "value-1")
if err != nil {
// Handle this error
}
futureGet := pipe.Get(ctx, "key-1")
err = pipe.Flush(context.Background())
if err != nil {
// Handle this error
}
err = futurePut.Result()
if err != nil {
// Handle this error
}
gr, err := futureGet.Result()
if err != nil {
// Handle this error
}
value, err := gr.String()
if err != nil {
// Handle this error
}
fmt.Println(value)
} |
It's merged into master. I released v0.5.0-beta.7. See the documentation on pkg.go.dev. |
Hello,
I notice that the pipeline feature was removed in latest version of olric (#8 (comment)). Is there an equivalent of this in
0.5.x
?The text was updated successfully, but these errors were encountered: