Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

simple erlang-like, actor model programming for lua

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 actor_post_office.lua
Octocat-spinner-32 actor_socket.lua
Octocat-spinner-32 test.lua
Octocat-spinner-32 test_many.lua
Octocat-spinner-32 test_ping.lua
Octocat-spinner-32 test_ping_more.lua
README
actor_post_office

Simple, erlang-like actor system for Lua.

Single main thread, non-distributed, local-only, based on coroutines.

It should be compatible with LuaLanes & LuaThreads, if you wish to
build a program with multiple apartments of OS threads.

Example, from test_ping.lua file...

  apo = require('actor_post_office')

  function player(self_addr, name)
    while true do
      ball = apo.recv()
      print(name .. " got ball, hits " .. ball.hits)
      apo.send(ball.from, { from = self_addr, hits = ball.hits + 1 })
    end
  end

  mike_addr = apo.spawn(player, "Mike")
  mary_addr = apo.spawn(player, "Mary")

  apo.send(mike_addr, { from = mary_addr, hits = 1})

A very similar, more advanced and featureful system is ConcurrentLua,
which was an inspiration to me for learning coroutines.

-- steve.yen



Something went wrong with that request. Please try again.