Create process queue in classic asp
here is the problem: there is a classic asp application that calls lame.exe to encode mp3 files many times a day and there is no control over how multiple users call lame.exe in other words, there is no queue for this purpose. so this is what I think of:
//below code all are pseudo-code
//process_flag and mp3 and processId all are reside in a database
function addQ(string mp3)
add a record to database
and set process_flag to undone
then goto checkQ
end function
function checkQ()
if there is a process in queue list and process_flag is undone
sort in by processID asc
for each processID
processQ(processID)
end for
end function
function ProcessQ(int processID)
run lame.exe with the help of wscript.exe
after doing the job set the process_flag to done
end function
so I just want to know if there is a better solution? or any other approaches out there?
Sincerely.
a source to share
Sounds like a sane approach for classic asp.
Just make sure that in your function checkQ
you only get the queue items for which the parameter is process_flag
set to undone
, or you can try to reprocess the same items over and over.
Read this article for a different approach using MSMQ - it starts by creating a new public queue and then posting messages to it from the asp page.It also required an additional executable to handle the queued items.
a source to share