Coder Social home page Coder Social logo

keanu's Introduction

Lol wat

You create modules of rules with no state. You spawn a process (not an actual process yet) that can be sent messages.

// from the bank_account_example in the tests directory

// BankAccount is the module
// receive is BankAccount.receive
//   - type: message -> state -> state
//   - it gets passed the message and the current state
//   - it returns the new state
// [] is the initial (seed) state
let account = spawn(BankAccount, "receive", [])

send(account, ["deposit", 50])  // send account a message of deposit 50
send(account, ["withdraw", 30]) // send account a message of withdraw 30

// pid_of_other_process will be sent ["balance", 20]
send(account, ["check_balance", pid_of_other_process])

Exampls

In Test Directory

  • Simple CQRS style bank account

TODO

  • Make send async
  • Make send concurrent
  • Can subscribe to changes in an actors state
  • Can unsubscribe from changes in an actors state
  • Supervisor layer for persistence
  • actor state is an immutable reference type (maybe something like a bitmap hash tries)

License

keanu is Copyright (c) 2015 James Hunter @cccc00 and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

keanu's People

Watchers

 avatar  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.