Git Product home page Git Product logo

fedis's Introduction

Fedis

Build Status

A mock Redis server built with Finagle.

Fedis's main use is as a drop-in replacement for a Redis server in functional/system tests.

Note that Fedis stores all data in-memory. Nothing is persisted to disk.

Benefits:

  • Isolation of tests: Run tests in parallel, each talking to its own Fedis server, with no fear of tests interfering with each other's data.

  • Easy teardown: When your test is complete, just shut down Fedis. Nothing to cleanup.

How to use

import com.github.cb372.fedis.Server

// Start a server, passing in a few configuration options
val server = Server.build(Options(port = 6379,
                                  serverPassword = Some("secret"),
                                  threadPoolSize = 10))

// ... do something ...

// Don't forget to shut down the server once you're done with it
server.close()

Download

  • Using Maven:

      <dependency>
          <groupId>com.github.cb372</groupId>
          <artifactId>fedis_2.9.2</artifactId>
          <version>1.1.0</version>
      </dependency>
      
      <repository>
        <id>cb372</id>
        <name>Chris Birchall's Maven repo</name>
        <url>http://cb372.github.com/m2/releases</url>
      </repository>
    
  • Using SBT:

      resolvers += "Chris Birchall's Maven repo" at "http://cb372.github.com/m2/releases"
      libraryDependencies += "com.github.cb372" %% "fedis" % "1.1.0"
    

Supported commands

See the Wiki page.

Restrictions

  • Performance: Don't expect the blazing speed of Redis!

fedis's People

Contributors

cb372 avatar licentious avatar seratch avatar

Stargazers

hongjun chen avatar Angus H. avatar Lukasz Konopski avatar Toshiyuki Takahashi avatar Masakazu Ishibashi avatar  avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

chenhj

fedis's Issues

Hash should be deleted when last key is removed

Redis automatically removes a hash when it no longer contains any keys:

redis> HSET foo bar "baz"
(integer) 1
redis> HDEL foo bar
(integer) 1
redis> TYPE foo
none

Fedis, on the other hand, does not:

redis> HSET foo bar "baz"
(integer) 1
redis> HDEL foo bar
(integer) 1
redis> TYPE foo
hash

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.