我正在使用equeue
通过将曲目推入其中来播放播放列表。假设一个小时后,一个新的播放列表(文件集)被推送到队列中。不幸的是,这些曲目无法开始播放,因为它们在先前队列中的文件[[after中排队。
input_fs = request.equeue(id="fs")
def clear_items(s) =
ret = server.execute("fs.primary_queue")
ret = list.hd(ret)
if ret == "" then
log("Queue cleared.")
(-1.)
else
log("There are still items in the queue, trying skip ...")
source.skip(s)
(0.1)
end
end
def clear_queue(s) =
add_timeout(fast=false, 0.5, {clear_items(s)})
end
server.register(namespace="fs",
description="Clear the all items of the filesystem queue.",
usage="clear",
"clear",
fun (s) -> begin clear_queue(input_fs) "Done." end)
当通过Telnet调用时有效,但是还会增加一些额外的超时。结果,下一个播放列表的安排会有些延迟。注意,我正在通过Python应用程序执行LiquidSoap调度,该应用程序使用定时线程推送到队列。
您说什么是解决此问题的推荐方法?