This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <caf/all.hpp> | |
| #include <caf/io/all.hpp> | |
| #include "AWORSet.hpp" | |
| #include "AWORSetActor.hpp" | |
| #include "CRDTClustering.hpp" | |
| #include "Utils.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val a = 13 | |
| class Rational(val num:Int, | |
| val denum:Int) { | |
| override def toString = { | |
| num.toString + "/" + denum.toString | |
| } | |
| def +(other:Rational) = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <caf/all.hpp> | |
| #include <boost/asio.hpp> | |
| #include <chrono> | |
| #include "CAF_TCP.hpp" | |
| using namespace caf; | |
| namespace ba = boost::asio; | |
| using std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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")>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stdafx.h" | |
| #include <functional> | |
| #include <iostream> | |
| #include <cmath> | |
| #include <vector> | |
| #include <chrono> | |
| #include <thread> | |
| #include <future> | |
| using namespace std; |