Skip to content
simple erlang-like, actor model programming for lua



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 })

  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.