Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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