hi,
i made it ;)
the equeue queue removal option didn't work out, because the primary
queue sometimes has more than one file queued.
so my friend was the polling function, yep, i know, that's not always a
good solution due to process time, but that worked out for me. here is
my solution to purge the request source's queue:

radio = playlist(...)
req = request.equeue(id="req", ... )

def check_q(s) =
        ret = server.execute("req.primary_queue")
        ret = list.hd(ret)
        if ret == "" then
                log("Queue cleared.")
                (-1.)
        else
                log("There are still files in the queue, trying skip...")
                source.skip(s)
                (0.5)
        end
end

def clear_queue(s) =
        add_timeout(fast=false,0.5,{check_q(s)})
end

server.register(namespace="req",
                description="Clear the queue of the request based source.",
                usage="clear",
                "clear",
                fun (s) -> begin clear_queue(req) "Done." end)

radio = fallback(req,playlist...)


a test on telnet "req.clear" starts my polling function until
primary_queue is empty, then stops the polling function. the fallback
switches over to other sources.
that's what i want.

i strongly recommend to make that native by a queue.flush function.

greez,
mccurly

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to