Comments (5)
Have a look at https://github.com/debasishg/scala-redis/blob/master/src/main/scala/com/redis/RedisClient.scala#L68 .. pipeline
supports pipelining with transactions. Without transactions, pipelining is supported with pipelineNoMulti
.. https://github.com/debasishg/scala-redis/blob/master/src/main/scala/com/redis/RedisClient.scala#L119 ..
Hope this helps.
from scala-redis.
Thanks, I could find a sample also in the test cases https://github.com/debasishg/scala-redis/blob/master/src/test/scala/com/redis/PipelineSpec.scala
However, my problem is that I want to execute 3 commands, the result of the first command should be the input for the successor 2 commands, when I tried this, the result of the first command resulted in "NullPointerException":
val result = redisClient.pipeline { c =>
c.rpush(subscribersList, userData) match {
case x @ Some(i) =>
c.set(email, i)
c.set(token, i)
x
case None => None
}
}
Also what is the return of this pipeline function, what is the Option[List[Any]]?
Thanks,
from scala-redis.
Thanks for reporting .. will take a look over the weekend .. Will it be possible to give a failing test case which I can run and see the problem ?
from scala-redis.
I don't think you can do arbitrary logic within a redis transaction. And redid returns a list containing the execution result of each of them. I think you can have an equivalent effect with the following ..
describe("pipeline5") {
it("should do pipelined commands") {
val res =
r.rpush("subscribersList", "subs1") match {
case x @ Some(i) =>
r.pipeline { p =>
p.set("email", i)
p.set("token", i)
p.llen("subscribersList")
}.get
case None => List()
}
println(res)
}
}
and this will print List(true, true, Some(1))
from scala-redis.
Thanks a lot, I already went ti this approach in temporary basis, however after your confirmation, I will stick to it, thanks a gain.
from scala-redis.
Related Issues (20)
- incorrect tag name on GitHub. s/v3.3.0/v3.30/ HOT 1
- Add support for variadic EXISTS
- How to create parser from object?
- How to use SSL Context to connect to Redis instance on AWS Elasticache with Encryption In-Transit enabled HOT 1
- Specify TTL for a key before pushing to Redis HOT 1
- Cannot find method "setCreated" in java.net.Socket. Unsupported JVM?
- Getting java.lang.Exception: Protocol error: Got (+,[B@38466868) as initial reply byte while pushing to redis quite frequently HOT 3
- Update: Missing stream commands XINFO, XADD, XTRIM, XDEL, XRANGE, XREVRANGE, XLEN, XREAD, XGROUP, XREADGROUP. XACK, XCLAIM, XAUTOCLAIM, XPENDING HOT 4
- Is server-assisted client side caching supported?
- Akka Dispatcher issue with scala redis
- How to add password to RedisClientPool? HOT 5
- "Exception: ERR wrong number of arguments f or 'expire' command" occurs when attempting to expire a key that contains spaces. HOT 11
- QUESTION - should `RedisClient` be shared or used as a singleton? HOT 3
- RedisClient in BATCH mode (for batchedPipeline) errors when sending commands to password-protected redis servers (initial AUTH command not sent) HOT 1
- can you support sentinel HOT 4
- Rate limit support
- Added LMOVE and BLMOVE but cannot test, blocked on PR
- Using with memcached redis protocol times out
- Read from lowest latency using AWS Elasticache Global datastore?
- Protocol errors while talking to Redis in Amazon ElasticCache HOT 1
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 scala-redis.