Author: derek Date: Mon Nov 13 01:57:45 2006 New Revision: 180 Modified: sofaswitch/trunk/callflow/docs/description.dxy Log: add comments describing how it works. Modified: sofaswitch/trunk/callflow/docs/description.dxy ============================================================================== --- sofaswitch/trunk/callflow/docs/description.dxy (original) +++ sofaswitch/trunk/callflow/docs/description.dxy Mon Nov 13 01:57:45 2006 @@ -24,7 +24,7 @@ graph file. Prior to execution of the python file, it is expected the server and relevant -SofaSwitch applications are running Separately, in a console, the user will +SofaSwitch applications are running. Separately, in a console, the user will invoke Python on the python file, and the desired actions happen. Each python file invokes the handling of variables for all items on the screen @@ -35,7 +35,38 @@ databases should be used. \section secPython Python internals -One difficulty +One difficulty with Python is the inability to handle threads well. They are +available, but are very heavyweight in terms of system load, but provide +limited gain. To illustrate, a multi threaded python application will run at +the same speed on a multiprocessor box as on a single cpu box. Worse, each new +thread running in Python is a whole new running interpreter, which consumes +system resources. This posed a problem - if the controller is going to handle +lots of concurrent calls, it would be poor practice to place each controller +handled call into a separate Python thread. + +We therefore base this code around +\htmlonly +<a href="http://twistedmatrix.com/trac">Twisted,</a> +\endhtmlonly +an event driven network framework written in Python. Using Twisted solved the +handling of the any number of asynchronous events.. Further could have one +psuedo thread per call, but in reality there is one thread in operation. One +psuedo thread per call makes things much simpler to analyse. + +The Python code will process the items on the graph, until it reaches the end +of the current graph. Execution then waits for a event to happen, +which move the current point of execution back to the relevant event handler. +Thus, a call flow graph in this system will only have one start point, but may +have many different endpoints. + +A particular graph is handled by a mixture of native Python code and machine +generated Python code. Native code is used to evaluate conditional statement, +increment statements etc. Machine generated code is used to do things such as +handle & record events,and move between items on the graph. + +To evaluate a conditional, the string is passed to the python command "eval", +which returns a True or False value. + \section secHelloWorld Hello World example Perhaps the simplest example of a graph you can create is the standard "Hello
participants (1)
-
SofaSWITCH SVN