Skip to content

Instantly share code, notes, and snippets.

#pragma once
#include <caf/all.hpp>
#include <caf/io/all.hpp>
#include "AWORSet.hpp"
#include "AWORSetActor.hpp"
#include "CRDTClustering.hpp"
#include "Utils.hpp"
val a = 13
class Rational(val num:Int,
val denum:Int) {
override def toString = {
num.toString + "/" + denum.toString
}
def +(other:Rational) = {
#pragma once
#include <caf/all.hpp>
#include <caf/io/all.hpp>
//from https://github.com/CBaquero/delta-enabled-crdts
#include "delta-crdts.hpp"
struct address {
string host;
val a = {println("val");2+2*2}
def foo = {println("def");2+2*2}
lazy val bar = {
println("lazy val")
2+2*2
}
println(foo+foo)
#include <caf/all.hpp>
#include <boost/asio.hpp>
#include <chrono>
#include "CAF_TCP.hpp"
using namespace caf;
namespace ba = boost::asio;
using std::endl;
#include <caf/all.hpp>
#include <boost/asio.hpp>
#include <chrono>
namespace CAF_TCP {
using namespace caf;
namespace ba = boost::asio;
using run_atom = atom_constant<atom("run")>;
//using dispatch = atom_constant<atom("disp")>;
#include <chrono>
#include <caf/all.hpp>
using namespace caf;
std::size_t d{ 10 };
using start_atom = atom_constant<atom("start")>;
behavior skynet(event_based_actor* self, actor const& parent, std::uint64_t count, std::uint64_t todo) {
@DePizzottri
DePizzottri / CAFMembering.cpp
Created December 13, 2016 08:23
CAFMembering.cpp
#include "stdafx.h"
#include <caf/all.hpp>
#include <caf/io/all.hpp>
/*
CAF cluster membering (Akka-like) toy project
usage
CAFMembering.exe -c -p 6666
CAFMembering.exe -p 6666
#include <chrono>
#include <caf/all.hpp>
using namespace caf;
void skynet(blocking_actor* self, actor const& parent, std::size_t num, std::size_t size, std::size_t div) {
if (1 == size)
{
self->send(parent, std::uint64_t{ num });
}
#include "stdafx.h"
#include <functional>
#include <iostream>
#include <cmath>
#include <vector>
#include <chrono>
#include <thread>
#include <future>
using namespace std;