[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Any tips on 2 process vinyl to file converter?
- From: Michal Kolodziejczyk <miko@...>
- Date: Thu, 27 Jan 2011 13:11:12 +0100
On 27.01.2011 00:30, Steve Litt wrote:
> Notice that the digitizer process polls the queue. I'd like the input process
> notify it every time a new file is pushed on the queue, but it was tough using
I would use pipes (assuming you are using linux/unix). It is easy then.
> I'm thinking of redoing this in Lua. Can coroutines be run in two different
> xterms? Can coroutines signal each other? Would you even recommend coroutines?
No. Yes. No.
Coroutines are like a functions called at some point in your code. Can
you see the output from two different functions in different xterms? (I
mean without "hacking").
> Does Lua have facilities to send Linux signals? Might they communicate via
> sockets? Any other words of wisdom?
Do you want to build a cross-platform solution, or just a short script
for your environment? It it is for yourself, and you want it to "just
work", i would use 2 processes using unix pipes (or tcp sockets with
I am attaching sample solution using named pipes. (run "lua vinyl.lua"
for the first process and "lua vinyl.lua something" for the second one).
if not INPIPE then
if not OUTPIPE then
print('METADATA INPUT LOOP PROCESS')
for line in io.lines() do
print('DIGITIZER/CONVERTER LOOP PROCESS')
while filename~='QUIT' do
print('Got file:', filename)
print('Got meta:', io.open(filename,'r'):read('*a'))
if arg then