Skip to content

Instantly share code, notes, and snippets.

View shinnya's full-sized avatar

foobar shinnya

View GitHub Profile
@shinnya
shinnya / failure_detector1.erl
Created May 8, 2020 00:50
Implementing the weakest failure detector for solving consensus Mikel Larrea, Antonio Fernández Anta, Sergio Arévalo
%% This module implements f-Resilient ♦S failure detector described in
%% "Implementing the weakest failure detector for solving consensus
%% Mikel Larrea, Antonio Fernández Anta, Sergio Arévalo"
-module(failure_detector).
-behaviour(gen_statem).
%% API
-export([start_link/3,
get_leader/0,
@shinnya
shinnya / Main.scala
Last active July 12, 2026 03:04
An example of FP testing using Continuation
import scala.concurrent.Await
import scala.concurrent.Future
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.higherKinds
import scalaz.ContT
import scalaz.std.scalaFuture.futureInstance
object Main {