@cicadoidea/actor

Actor model for nodejs.

Usage no npm install needed!

<script type="module">
  import cicadoideaActor from 'https://cdn.skypack.dev/@cicadoidea/actor';
</script>

README

Actor

Actor model for nodejs.

  • npm install @cicadoidea/actor

Examples

Basic ping-pong

const { actor_t } = require('@cicadoidea/actor/lib/actor')

let a = new actor_t()

a.on('ping', re => {
  console.log('a on ping')
  re.send('pong', a)
})

let b = new actor_t()

b.on('pong', re => {
  console.log('b on pong')
  re.send('ping', b)
})

a.send('ping', b) // loop forever

Community

Contributions are welcome, see current TODO list for tasks.
(Please add yourself to the AUTHORS list if you made any contributions.)

License