Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
simple erlang-like, actor model programming for lua
Lua
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
LICENSE
README
actor_post_office.lua
actor_socket.lua
test.lua
test_many.lua
test_ping.lua
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.