Sort of silly?,

I am not sure what you are talking about.
I
t's called *event*Consumer right? what do you mean by event based?

There is no need to create a session?

con = freeswitch.EventConsumer("all");

now you have a consumer obj

every time you call con:pop() with no arg you will either get an event or
nil when there are no events to consume.
every time you call con:pop(1) the consumer object will block until there is
an event.

So you use the first way in conjunction with some other lock to do async or
the 2nd way you do a dedicated blocking loop.

I don't know what you said in #lua but, umm duhhhh I think we have an event
driven programming under control.....
We have a dedicated eventing engine in the core with scaling backend
dispatcher threads that can handle hundereds of thousand
of events at a time.

There is also Event Socket (the word *event* again) that can connect to tcp
and listen for *events*

you can also write your code in C with the trivial module API that allows
you to bind to an event internally and pretty much do whatever you want.



2009/3/27 Matthew Fong <[email protected]>

> I've been playing around with using freeswitch.EventConsumer in a lua
> process that starts-up when FS boots, and stays in the background. I've
> setup the example on the wiki, but the example uses
> session:execute("sleep",1000), and essentially loops every second until an
> event is fired. I'm wondering if there is a more event-driven way to
> accomplish this?
> I tried asking for help in #lua, but they said the project (FS) needed to
> implement event-driven programming for this to work. To me, it seems sort of
> silly to implement freeswitch.EventConsumer without a way for it to be
> executed event-wise
>
> Is using lua ESL the only option? There isn't any lua example scripts in
> libs/esl/lua to demonstrate how to handle events.
>
> if mod_lua can't handle events, can the mod_javascript utilize it? Thanks.
>
> --matt
>
> _______________________________________________
> Freeswitch-users mailing list
> [email protected]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:[email protected] <msn%[email protected]>
GTALK/JABBER/PAYPAL:[email protected]<paypal%[email protected]>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:[email protected] <sip%[email protected]>
iax:[email protected]/888
googletalk:[email protected]<googletalk%3aconf%[email protected]>
pstn:213-799-1400
_______________________________________________
Freeswitch-users mailing list
[email protected]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Reply via email to