[TransWarp] input-driven application

Phillip J. Eby pje at telecommunity.com
Fri May 16 14:27:09 EDT 2003


At 06:12 PM 5/16/03 +0300, alexander smishlajev wrote:
>Phillip J. Eby wrote:
>>Keep in mind that for this to work, each of your filter objects needs to 
>>be a "real" ICmdLineApp in the sense that it uses only its stdin and 
>>stdout, OR, you must run each filter one after the other, with the 
>>intervening pipes having sufficient space to hold the results until 
>>you're ready to run the next filter.
>
>i am not sure if i understood you right.  if you meant that each of the 
>filters may do it's work in a whole before passing result to the next one, 
>then it's not the case.  the application is meant to _continuously_ 
>receive data from one device (connected to tty or tcp socket), transform 
>it in some way and pass to another device.
>
>on the other hand, i cannot say that each "filter" uses only stdin and 
>stdout; some of them should operate with 3 streams: input, output and 
>output or input and input, output.

I only meant to say that each filter should use only its 'stdin' attribute 
as stdin (for example), and not call any Python functions that use 
'sys.stdin', 'sys.stdout', or 'sys.stderr' directly.



>   the whole assembly may look like this:
>
>   DA1 => ILC => T => OLC => DA2
>       <=                 <=
>
>where DA is device adaptor (abstracting socket, tty or disk file), ILC - 
>input link control, T - transformation layer, OLC - output link control.
>
>in this scheme, T is classic filter by all means, but ILC and OLC are 
>not.  ILC has it's stdin and stdout on the left side and additional 
>file-like object (pipe input) on the right side.  OLC has it's stdin and 
>stdout on the right side and additional file-like object (pipe output) on 
>the left side.
>
>i am not sure yet how to describe the third stream for link control 
>components.  if you have something to suggest, i would highly appreciate it.

Well, as long as you have a pipe mechanism, there is nothing stopping you 
from defining attributes such as say 'linkout' and 'linkin' on the 
appropriate pieces, and then grafting them with a pipe as you do all the 
others.  There is nothing magical about the 'stdin', 'stdout', etc. 
bindings on PEAK command objects.

But perhaps I'm misunderstanding your question.




More information about the PEAK mailing list