Dirk Meyer wrote:
I don't like twisted. Why? It's a huge monster, including not only
stuff we need like xmlrpc and a web server but also stuff we don't
need and a main loop that is too complex. I saw in the code that it
waits for dead children not started by any part of twisted .. Hey,
that are my children, don't touch them! The next problem is, that we
have one xmlrpc server in the recordserver. But when the schedule
changes, Freevo has to ask the recordserver for a new schedule, the
recordserver can't send it to Freevo because a) freevo has no xmlrpc
port and b) if you have more than one freevo, how should the server
know that? And we need a way to send stuff to Freevo, like the
webserver may want to say 'start this audio playlist please'.

Regarding Twisted, it is a very good network application framework, it supports many protocols, good design, and other stuff. Twisted made it very convenient to impliment recordserver and webserver. Well, webserver was a bit of a hack in an effort to reuse the old CGI code.


So, Freevo has come a long way since then and we need something more. Well, we need something different. I am a huge fan of systems with multiple processes that communicate with a bus over the network. Even more so with asynchronous design.


A solution to all this (and more): we use pymbus. Mbus is a protcol
for host or link local communication. As the name says, it's a bus. So
every programm on the bus can get the messages (you can also send a
message directly). For detailed information, please look at
http://www.mbus.org. A brief summary:

o mbus is secure, it uses encryption on the bus. o mbus is plain ascii (after decrypted), so every app with the key can
read it very easy and apps like mspy can be used for debugging and
apps like mbussh can be used to send commands to an app
o you get notice when an app joins / leaves the bus
o you can define names for apps so you understand what they do
o you have events _and_ client server rpc communiaction. o Bindings for C/C++/Perl/Python

This all sounds wonderfull. :)


Example:
Freevo starts, joins the bus and ask: Freevo: I need recording informations. Anyone here can provide them?


Case a: recordserver is running:
RS: sure, I'm a recordserver, I can record dvb and analog. Here is my
current schedule.
Case b: no recordserver, Freevo still has no schedule and will never
aks again. When the recordserver starts:
RS: Hi, I'm a recordserver, here is my schedule.

Freevo knows there is a recordserver with the name RS on the bus and
the user wants to schedule something.
Freevo->RS (unicast): RS, please record xy
RS no everyone: my schedule changes: here is a new schedule
RS->Freevo: done!

Next is the webserver knowing that Freevo is running:
WS->Freevo: please play playlist xy

This is the kind of two-way (n-way!) communication that we need.


You have an isdn watcher and a new call comes in. It doesn't know
about Freevo at all:
ISDN: in case someone wants to know this: the telephone is rinning.
A special Freevo plugin notice that and mutes the background audio
playback.

Hey, stop stealing my ideas! ;)

Also with this architecture I forsee more Freevo helpers, and more programs outside of Freevo interoperating with each other...


And we can also remove the bad hacked network interface, you can send
events directly to Freevo:
app->Freevo: Button 'DISPLAY' is pressed
or
app->Freevo: Event(OSD_MESSAGE, arg='hi')

That's what mbus can do, and much more. Read the rfc on mbus if you
want to know more. The second lib pynotifier is a simple (!) main
loop. The author of pynotifier and the current maintainer of pymbus
(also using Freevo) also has a simple webserver and non blocking http
client.

I want to know more. I will go read...


So, there is no need for twisted, mbus is the future[1]. And the
author of pynotifier will include pynotifier in Freevo when he has a
free weekend.

Sounds good.


Comments? Someone with a good argument against it?

Even though I wrote most of the twisted stuff you'll have no argument from me. I really like this kind of architecture.


-Rob


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Freevo-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to