lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I think that statement has no basis. What is quite possibly the largest use of lua today, World of Warcraft, is almost entirely event driven.

In response to the question, support is not directly built into Lua, but should be very trivial to support given the ability to pass functions, etc.

Sent from my Verizon Wireless BlackBerry

From: Linker
Date: Tue, 2 Jun 2009 03:35:22 +0800
To: Lua list<>
Subject: Re: Lua Event driven programming

  Event-driven is no a good choice for lua programming.Coroutine is a better choice.

On Mon, Jun 1, 2009 at 19:04, Lloyd <> wrote:


I would like to know the following kind of thing is possible with Lua. I am trying to implement a simple event driven system. Lets start with a sample

--My script

function MyEventHandler1(EventObj obj)
--some action mechanism

function MyEventHandler2(EventObj obj)
--some action mechanism

The above may not be a working Lua script, but I am trying to depict my idea.

"MyEventHandler1,MyEventHandler2" are two event handler functions which receives an event object, which is thrown by the "Event1" or "Event2". There will be a function "Event1" implemented in C. I would like to know whether there is a mechanism to throw Events from the functions like "Event1" and handle it using the above said method.

The above may not be a good solution, is there is any better way for doing an event driven program.


Scanned and protected by Email scanner

Linker Lin