Giter Club home page Giter Club logo

isred's Introduction

IsRed Build Status

A non-blocking, asynchronous Redis client for Scala

Adding it to your Project

This project is not currently hosted on any publicly available maven repositories. However, you can still add it to your project by publishing it to your local repository.

Run the following commands:

git clone https://github.com/Nycto/IsRed.git /tmp/IsRed;
cd /tmp/IsRed;
sbt publish-local;

Then, just add this to your build.sbt file and recompile:

libraryDependencies ++= Seq(
    "com.roundeights" %% "isred" % "0.2"
)

Usage

Once you have this library added to your build configuration as a dependency, using it is simple:

package com.example

import com.roundeights.isred.Redis
import scala.concurrent.ExecutionContext.Implicits.global

object Example extends App {

    // Spin up a new connection pool
    val redis = new Redis(
        host = "localhost",
        port = 6379,
        maxConnect = 5
    )

    // Set a value in redis, then immediately read the value back
    redis.set("myKey", "some value")
        .flatMap( _ => redis.get[String]("myKey") )
        .onComplete { case value => {
            println( value )
            redis.shutdown
        }}
}

In general, every Redis operation maps to a function on the Redis class. Requests are made asynchronously, which means that each function returns a Future.

License

This project is released under the MIT License, which is pretty spiffy. You should have received a copy of the MIT License along with this program. If not, see http://www.opensource.org/licenses/mit-license.php.

isred's People

Contributors

nycto avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

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.