[Freeswitch-users] freeswitch.EventConsumer, can be utilized event-based
Anthony Minessale
anthony.minessale at gmail.com
Fri Mar 27 07:52:48 PDT 2009
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 <mattdfong at gmail.com>
> 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
> Freeswitch-users at lists.freeswitch.org
> 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:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090327/451757a5/attachment-0002.html
More information about the FreeSWITCH-users
mailing list