Giter Site home page Giter Site logo

sedis's People

Contributors

divarvel avatar flurdy avatar graingert avatar masuhajime avatar ph2734 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sedis's Issues

simplifying code and make it more variable

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.

Add wrapper for hget

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.

Scala 2.11

java.lang.NoClassDefFoundError: scala/collection/convert/DecorateAsJava
When i try use to set and get, at Pool.

http://pk11-scratch.googlecode.com/svn/trunk returning 404

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.

Redis connection closes when multiple tests are running in the same time

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)

hmget wrapper returns a list that can contain nulls

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.