GithubHelp home page GithubHelp logo

akhil / scaerospike Goto Github PK

View Code? Open in Web Editor NEW

This project forked from worldline-messaging/scaerospike

0.0 2.0 0.0 162 KB

Our fork of the Tapad Scala non-blocking Aerospike client

Scala 100.00%

scaerospike's Introduction

Build Status

Intro

Scaerospike is a Scala wrapper around the Aerospike 3.x series asynchronous Java client. It uses the Scala 2.10 Futures API.

Getting started

    import com.tapad.aerospike._
    import scala.concurrent.Future
    import scala.concurrent.duration._
    import scala.util.{Failure, Success}
    import scala.concurrent.ExecutionContext.Implicits.global

    val client = AerospikeClient(Seq("192.168.210.129"))

    val devices = client.namespace("devices").set[String, String]("setName")

    val write : Future[Unit] 	          = devices.put("deviceA", "foo")
    val read  : Future[Option[String]]    = devices.get("deviceA")

    val result = write flatMap (_ => read)

    result.onComplete {
      case Failure(ex) 		=> ex.printStackTrace()
      case Success(value) 	=> println("Successfully wrote and read %s".format(value))
    }

    Await.result(result, 10 seconds)

scaerospike's People

Contributors

zaneli avatar daggerrz avatar

Watchers

Akhil Kodali 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.