pk11 / sedis Goto Github PK
View Code? Open in Web Editor NEWa thin scala wrapper for jedis (https://github.com/xetorthio/jedis)
License: MIT License
a thin scala wrapper for jedis (https://github.com/xetorthio/jedis)
License: MIT License
Not sure if I'm right, but this might suit sedis better. Added SPool which takes as constructor parameter redis.client.util.Pool[Jedis], which is parent class of both:
class Pool(override val underlying: JedisPool) extends SPool(underlying){
}
class SentinelPool(override val underlying: JedisSentinelPool) extends SPool(underlying){
}
class SPool(val underlying: redis.clients.util.Pool[Jedis]) {
def withClient[T](body: Dress.Wrap => T): T = {
val jedis: Jedis = underlying.getResource
try {
body(Dress.up(jedis))
} finally {
jedis.close()
}
}
def withJedisClient[T](body: Jedis => T): T = {
val jedis: Jedis = underlying.getResource
try {
body(jedis)
} finally {
jedis.close()
}
}
}
not making pull request, since I'm not sure if your original code is intended.
unless you own the sedis.org domain, in which case ALIAS the A record to github.io. Also give me permission to continue managing maven releases.
@pk11 ping
Hi, a wrapper around hget
should be added with a return of type Option[String]
.
Currently there is no wrapper around hget
, wich can return null
. I can write a PR adding a wrapper of type String x String => Option[String]
if you are interested.
java.lang.NoClassDefFoundError: scala/collection/convert/DecorateAsJava
When i try use to set and get, at Pool.
Compilation error
value must is not a member of Boolean
In attempting to use your library in a project, I've suddenly starting getting issues regarding
sbt.ResolveException: unresolved dependency: org.sedis#sedis_2.10.0;1.1.1
At first I thought I was going mad, but it looks like the site is returning 404, which is why its not working.
I have few test cases in one class and only one will succeed but all others are failed with redis pool exception. How can I make sure other tests can also get the connection from pool?
[error] JedisConnectionException: : Could not get a resource from the pool (Pool.java:22)
[error] redis.clients.util.Pool.getResource(Pool.java:22)
[error] org.sedis.Pool.withJedisClient(sedis.scala:79)
[error] com.typesafe.plugin.RedisPlugin$$anon$1.set_(RedisPlugin.scala:147)
[error] com.typesafe.plugin.RedisPlugin$$anon$1.set(RedisPlugin.scala:106)
[error] play.api.cache.Cache$.set(Cache.scala:58)
[error] controllers.Security$ResultWithToken.withTokenShort(Security.scala:51)
[error] controllers.Security$ResultWithToken.withTempToken(Security.scala:62)
[error] controllers.Security$$anonfun$HasToken$1$$anonfun$apply$3.apply(Security.scala:83)
[error] controllers.Security$$anonfun$HasToken$1$$anonfun$apply$3.apply(Security.scala:83)
[error] controllers.Security$$anonfun$HasToken$1.apply(Security.scala:82)
[error] controllers.Security$$anonfun$HasToken$1.apply(Security.scala:76)
[error] play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:221)
[error] play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:220)
Caused by: java.lang.IllegalStateException: Pool not open
at org.apache.commons.pool.BaseObjectPool.assertOpen(BaseObjectPool.java:137)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1065)
at redis.clients.util.Pool.getResource(Pool.java:20)
Hi, the hmget
wrapper return a list that can contain null
, since the java List can contain null
is the key is not defined.
Maybe the retur type should be List[Option[String]]
instead of List[String]
. I can write a PR if thats ok with you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.