A basic Kotlin implementation of Facebook's memcache lease functionality.

Overview

Liftgate Lease

A basic Kotlin implementation of Facebook's memcache lease functionality.

How it works

If the cache key is empty or has been invalidated recently, the first client to access the cache will be directed to grab this value from the database.

During the process, any future client (before the most recent value is set) will be directed to use a stale (or out-of-date) value for this key.

For additional information on Facebook's implementation of this in memcache:

Lease Strategy

Liftgate's lease implemention allows you to choose multiple lease strategies.

  1. Expired: Returns the outdated value as the newest value is computed asynchronously.
  2. Compute: Computes the latest value if the current value is non-existent.
  3. Eager: Does the computational logic above, while also eagerly computing on class creation.

Lease Dependencies

Liftgate's lease implementation has a dependency implemention that allows a user to easily invalidate dependant leases.

val lease by lease(
    dependencies = listOf(LeaseTests::class)
) {
    // your computational logic here
}

...
LeaseDependency
    .invalidate(
        LeaseTests::class
    )

Lease Delegate

Liftgate's lease class implements Kotlin's ReadOnlyProperty.

val lease by lease {
    // your computational logic here
}
You might also like...
A basic, incomplete, buggy, far from efficient UI toolkit for Kotlin/Android. An experiment for fun and to learn.
A basic, incomplete, buggy, far from efficient UI toolkit for Kotlin/Android. An experiment for fun and to learn.

Apex Apex is just a simple proof of concept to demonstrate how easily you can build your own UI Toolkit from scratch. This code base is most likely fu

UW Homework: Basic Kotlin

UW Homework: Basic Kotlin This homework is designed to force you to exercise you

Examples for using Kotlin at a basic level for Android application development.
Examples for using Kotlin at a basic level for Android application development.

Kotlin Android Jetpack Basics Ejemplos para usar Kotlin a nivel básico para el desarrollo de aplicaciones Android. Kotlin Android Jetpack Basics Acerc

Basic application that uses Retrofit, Moshi and Coil libraries to parse data from web API

DogAlbum_Api_CodeThrough Basic application that uses Retrofit, Moshi and Coil libraries to parse data from web API This folder contains the completed

A basic library that enables easy composition of gesture sequence recognition on a view

GestureSequence A basic library that enables easy composition of gesture sequence recognition on a view. Basic API looks like: // Perform action() whe

A basic template ecommerce application with payment integration made using Android Architechture componets
A basic template ecommerce application with payment integration made using Android Architechture componets

ShopIt ShopIt is a basic template ecommerce application with payment integration(RazorPay), made using Android Architechture componets and Material Co

A single screen app learn in google basic Android Development course.

Project: Lemonade App - Starter Code Starter code for the first independent project for Android Basics in Kotlin Introduction This is the starter code

An open source app which can be used to do basic surveys
An open source app which can be used to do basic surveys

SurveyApp This is an open source app which can be used to do basic surveys. It supports multiple question types. For demo please check the releases pa

Microservice-arch - Basic micro service architecture using spring boot

Readme 4 applications are created: discovery-service: every application register

Owner
null
Basic-Android-Project - A Basic Android Project with proper structure and all necessary dependencies

Basic-Android-Project A Basic Android Project with proper structure and all nece

Ameer Hamza 2 Mar 18, 2022
Kotlin implementation of basic blockchain technology.

kotlin-blockchain Kotlin implementation of basic blockchain technology. Features: Data and storage Mining and block validation Hashing and previous bl

null 2 May 15, 2022
Kotlin snippets that you can understand quickly, using only stdlib functionality.

Support this and other projects from Ivan Mwiruki here. 30 seconds of Kotlin Curated collection of useful Kotlin 1.3 snippets that you can understand

Ivan Moto 246 Dec 19, 2022
Kotter - aims to be a relatively thin, declarative, Kotlin-idiomatic API that provides useful functionality for writing delightful console applications.

Kotter (a KOTlin TERminal library) aims to be a relatively thin, declarative, Kotlin-idiomatic API that provides useful functionality for writing delightful console applications.

Varabyte 348 Dec 21, 2022
Library to generalize functionality between several projects

libreforge libreforge is a library to generalize functionality between several projects, notably EcoArmor, EcoWeapons, and Reforges. Get from JitPack:

Auxilor 20 Dec 20, 2022
PokeDexApi is a simple version of PokeApi with search functionality.

PokeDex Api PokeDexApi is a simple version of PokeApi with search functionality based on KTOR. Documentation Base Url https://poki-dex.herokuapp.com E

Rohit Sharma 1 Jan 15, 2022
Modern flashlight app with dim functionality on Android 13+

FlashDim About this project Features Download Supported devices Screenshots Contribute Used Icons License About this project Starting with Android 13,

Niko Diamadis 35 Jan 2, 2023
Android Kotlin Fundamentals 01.2: Anatomy of Basic Android Project

Welcome to Android Kotlin Fundamentals 01.2: Anatomy of Basic Android Project ?? Codelab de android para practicar apps Android con Kotlin ?? Homepage

null 0 Oct 23, 2021
Basic RestAPI to practice my skills working with Spring/Kotlin/Gradle

Dining Review API Dining Review API is a basic RestAPI roughly based on the requirements given in a Milestone project in the Building REST APIs with J

Jonas Kuhlo 0 Nov 18, 2021
A basic, incomplete, buggy, far from efficient UI toolkit for Kotlin/Android. An experiment for fun and to learn.

Apex Apex is just a simple proof of concept to demonstrate how easily you can build your own UI Toolkit from scratch. This code base is most likely fu

Romain Guy 79 Sep 7, 2022