Git Product home page Git Product logo

distributed-kotlin's Introduction

distributed-kotlin

This repository contains some utilies for distributed systems in the Kotlin programming language. The OSS license can be found in the LICENSE.md file of the repository.

Installation

This library is available on JitPack.io. Make sure to add the following Maven repository in your root build.gradle file :

allprojects {
	repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

You can now add the library modules in your application build.gradle file :

dependencies {
    implementation "com.github.alexandrepiveteau.distributed-kotlin:distributed-causal-graphs:1.1.0"
	implementation "com.github.alexandrepiveteau.distributed-kotlin:distributed-cvrdts:1.1.0"
	implementation "com.github.alexandrepiveteau.distributed-kotlin:distributed-woot:1.1.0"
}

Usage

The library contains the following modules :

  • distributed-causal-graphs - An implementation of causal graphs, including CausalGraph<O, S> and CausalGraphYarn<O, S> with their mutable counterparts.
  • distributed-cvrdts - An implementation of some popular CvRDTs, including GSet<T>, PNSet<T> and MCSet<T>.
  • distributed-woot - An implementation of the Woot linear data structure.

distributed-cvrdts

The library offers multiple CvRDT data structures. Each data type is a state-based CRDT. Essentially, the GSet<T>, PNSet<T> and MCSet<T> classes all implement the Set<T> interface. Each of these data type is immutable, and multiple CRDTs of the same type can be merged by using their merge(...) function.

Here is an example of usage for the MCSet<T> data type :

var first: MCSet<String> = emptyMCSet()
var second: MCSet<String> = emptyMCSet()

first += "Alice"
first += "Bob"
first -= "Bob"
second += "Bob"
second += "Charlie"

val merged = first.merge(second) // Contains "Alice" and "Charlie".

distributed-kotlin's People

Contributors

alexandrepiveteau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.