Skip to content
Aerospike client for Monix
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project
scripts
src
.gitignore
.scalafmt.conf
.travis.yml
README.md
build.sbt

README.md

Build Status codecov Maven Central

Aerospike Monix Client

Aerospike + Monix = aerospike-monix

Installation

libraryDependencies += "com.dragishak" %% "aerospike-monix" % "0.0.6"

Code examples

import com.dragishak.aerospike._
import com.aerospike.client.{AerospikeClient, Bin, Key, Record}
import com.aerospike.client.async.{EventPolicy, NioEventLoops}
import com.aerospike.client.policy.ClientPolicy
import monix.eval.Task
import monix.execution.Scheduler.Implicits.global


val eventPolicy = new EventPolicy()
val eventLoops = new NioEventLoops(eventPolicy, 0)
val clientPolicy = new ClientPolicy()
clientPolicy.eventLoops = eventLoops

val aerospikeClient = new AerospikeClient(clientPolicy, "localhost", 3000)
val client = AerospikeMonixClient(aerospikeClient, eventLoops)

val key = new Key("test", null, "key1")
val bin = new Bin("bin1", "value2")

val task: Task[(Boolean, Record, Boolean)] = for {
  _       <- client.put(key, bin)
  exists  <- client.exists(key)
  res     <- client.get(key)
  existed <- client.delete(key)
} yield (exists, res, existed)

Currently Supported Operations

  • put
  • get
  • delete
  • exists
  • operate
You can’t perform that action at this time.