lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thursday 27 January 2011 07:11:12 Michal Kolodziejczyk wrote:
> 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 shellscripts.
> 
> 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
> luasocket).
> 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).
> 
> Regards,
> 	miko

Thanks Miko,

Reading your code made me zero in on my requirements a little more. On 
requirement I forgot to elaborate on is the ability to edit the queue with an 
editor. That way when you accidentally put the wrong record on the turntable 
(and that happens more than I'd like to admit), I can quickly recover with a 
minimum of lost time.

This actually might end up being something better done with shellscripts, or 
maybe shellscripts that call small Lua programs to do specific tasks that are 
tough in shellscripts.

Thanks for putting things in perspective.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt