https://github.com/christianparpart/actor-model
C++17 Actor Model header-only library
https://github.com/christianparpart/actor-model
actor-model cplusplus cplusplus-17 library
Last synced: 7 months ago
JSON representation
C++17 Actor Model header-only library
- Host: GitHub
- URL: https://github.com/christianparpart/actor-model
- Owner: christianparpart
- Created: 2018-10-12T22:11:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T07:21:43.000Z (8 months ago)
- Last Synced: 2025-03-19T03:54:37.338Z (7 months ago)
- Topics: actor-model, cplusplus, cplusplus-17, library
- Language: C++
- Size: 65.4 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C++17 Actor Model header-only library
This is a C++17 header-only Actor Model library. It was written purely out of fun.
### Example
```cpp
#include
#include
#includeint main()
{
auto logger = actor::Actor([](actor::Receiver receiver) {
for (actor::Message& mesg : receiver)
mesg.match([](string const& s) { std::cout << "LOG(str): " << s << '\n'; })
.match([](int val) { std::cout << "LOG(num): " << val << '\n'; })
.match([](bool val) { std::cout << "LOG(bool): " << boolalpha << val << '\n'; })
.otherwise([] { std::cout << "LOG(?): Unhandled!\n"; });
});logger << std::string("Hello, World");
logger << 42;
logger << true;
logger << 2.81;return EXIT_SUCCESS;
}
```### References
* https://www.brianstorti.com/the-actor-model/
* https://www.justsoftwaresolutions.co.uk/threading/all-the-worlds-a-stage.html