Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dragisak/aerospike-monix
Aerospike client for Monix
https://github.com/dragisak/aerospike-monix
aerospike monix scala
Last synced: 18 days ago
JSON representation
Aerospike client for Monix
- Host: GitHub
- URL: https://github.com/dragisak/aerospike-monix
- Owner: dragisak
- Created: 2018-08-23T16:53:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T04:41:11.000Z (about 6 years ago)
- Last Synced: 2023-06-30T04:41:50.442Z (over 1 year ago)
- Topics: aerospike, monix, scala
- Language: Scala
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/dragisak/aerospike-monix.svg?branch=master)](https://travis-ci.org/dragisak/aerospike-monix)
[![codecov](https://codecov.io/gh/dragisak/aerospike-monix/branch/master/graph/badge.svg)](https://codecov.io/gh/dragisak/aerospike-monix)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.dragishak/aerospike-monix_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.dragishak/aerospike-monix_2.12)## Aerospike Monix Client
[Aerospike](https://www.aerospike.com/) + [Monix](https://monix.io/) = **aerospike-monix**
### Installation
```sbtshell
libraryDependencies += "com.dragishak" %% "aerospike-monix" % "0.0.6"
```### Code examples
```scala
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.globalval eventPolicy = new EventPolicy()
val eventLoops = new NioEventLoops(eventPolicy, 0)
val clientPolicy = new ClientPolicy()
clientPolicy.eventLoops = eventLoopsval 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