Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leont/actor--
A header-only C++17 type-safe actor model threading library
https://github.com/leont/actor--
Last synced: 2 months ago
JSON representation
A header-only C++17 type-safe actor model threading library
- Host: GitHub
- URL: https://github.com/leont/actor--
- Owner: Leont
- License: isc
- Created: 2014-08-20T10:38:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-04-05T22:40:27.000Z (almost 6 years ago)
- Last Synced: 2024-05-01T22:05:40.858Z (8 months ago)
- Language: C++
- Homepage:
- Size: 55.7 KB
- Stars: 8
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
This is a header-only C++17 library implementing actor-based threading.
Messages can be send using the send method, taking zero or more arguments:
handle.send(1, "foo"s);
And received using the receive function:
receive(
[] (int number, const std::string& description) {
// ...
},
[] (const some_object&) {
// ...
},
[] (stop) {
// stop the loop
}
);Receive will match each message against each selector, and will return when it finds a match. One can also receive with a timeout.
A more extensive example can be found in the examples/ folder, along with its erlang equivalent (taken from the Debian language shoot-out).
This software may by used and distributed under the ISC licence