Git Product home page Git Product logo

actor-zeta's Introduction

Build Status

actor-zeta

actor-zeta is an open source C++11/14/17 virtual actor model implementation featuring lightweight & fast and more.

Example

class method mode

#include <actor-zeta/core.hpp>

using actor_zeta::basic_async_actor;

class key_value_storage_t final : public basic_async_actor {
public:
    explicit key_value_storage_t(dummy_supervisor &ref) : basic_async_actor(ref, "storage") {

        add_handler(
                "init",
                &key_value_storage_t::init
        );

        add_handler(
                "search",
                &key_value_storage_t::search
        );

        add_handler(
                "add",
                &key_value_storage_t::add
        );

    }

    ~key_value_storage_t() override = default;

    void init() {
       /// ...
    }

private:

    void search(std::string &key) {
        /// ...
    }

    void add(const std::string &key, const std::string &value) {
        /// ...
    }
    
};

lambda mode

#include <actor-zeta/core.hpp>

using actor_zeta::basic_async_actor;

class storage_t final : public basic_async_actor {
public:
    storage_t() : basic_async_actor(nullptr, "storage") {
        add_handler(
                "update",
                [](storage_t & /*ctx*/, query_t& query) -> void {}
        );

        add_handler(
                "find",
                [](storage_t & /*ctx*/, query_t& query) -> void {}
        );

        add_handler(
                "remove",
                [](storage_t & /*ctx*/, query_t& query) -> void {}
        );
    }

    ~storage_t() override = default;
};

For Users

Add the corresponding remote to your conan:

    conan remote add jinncrafters https://api.bintray.com/conan/jinncrafters/conan

Basic setup

    $ conan install actor-zeta/1.0.0a4@jinncrafters/stable

Project setup

If you handle multiple dependencies in your project is better to add a conanfile.txt

[requires]
actor-zeta/1.0.0a4@jinncrafters/stable

[generators]
cmake

Dependencies

  • CMake >= 2.8

Supported Compilers

  • GCC >= 4.8.5
  • Clang >= 3.3
  • Microsoft Visual Studio >= 2015

Supported Operating Systems

  • Linux
  • Mac OS X
  • FreeBSD 10
  • Windows >= 7 (static builds)

actor-zeta's People

Contributors

aerfus avatar kotbegemot avatar petrovigor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.