From 06523d87adcf6483749a5a27328dc97a8cdbc194 Mon Sep 17 00:00:00 2001 From: Romain Beauxis Date: Tue, 1 Oct 2024 23:46:58 -0500 Subject: [PATCH] Add doc. --- doc/content/liq/task-example.liq | 5 + doc/content/liq/task-with-queue.liq | 12 ++ doc/content/threads.md | 45 +++++ doc/dune.inc | 297 ++++++++++++++++++++++++++++ 4 files changed, 359 insertions(+) create mode 100644 doc/content/liq/task-example.liq create mode 100644 doc/content/liq/task-with-queue.liq create mode 100644 doc/content/threads.md diff --git a/doc/content/liq/task-example.liq b/doc/content/liq/task-example.liq new file mode 100644 index 0000000000..b667f0083d --- /dev/null +++ b/doc/content/liq/task-example.liq @@ -0,0 +1,5 @@ +def connect_callback() = + ignore(http.post("http://host/on_connect")) +end + +thread.run(connect_callback) diff --git a/doc/content/liq/task-with-queue.liq b/doc/content/liq/task-with-queue.liq new file mode 100644 index 0000000000..d07692d499 --- /dev/null +++ b/doc/content/liq/task-with-queue.liq @@ -0,0 +1,12 @@ +# Add 3 foo queue +settings.scheduler.queues.set([ + ...settings.scheduler.queues(), + ("foo", 3) +]) + +def connect_callback() = + ignore(http.post("http://host/on_connect")) +end + +# Execute inside the foo queue +thread.run(queue="foo", connect_callback) diff --git a/doc/content/threads.md b/doc/content/threads.md new file mode 100644 index 0000000000..1f17b46a7c --- /dev/null +++ b/doc/content/threads.md @@ -0,0 +1,45 @@ +# Threads + +The main purpose of liquidsoap is to create real time media streams. When streams are created, everything that +is needed to compute them needs to happen very quickly so that we make sure that the stream can in fact +be created in real time. + +When a tasks is required that may take some time and whose result is not required for the stream generation, +for instance when executing a `on_stop` or `on_connect` callback, it can be useful to execute this task in a _thread_. + +Threads in liquidsoap are callback functions that are executed by an asynchronous queue. Here's an example: + +```{.liquidsoap include="task-example.liq"} + +``` + +By default, there are two type of queues available in liquidsoap: + +- `generic` queues +- `non_blocking` queues + +By convention, tasks that are known to be executing very fast should be sent to the +`non_blockin` queues and all the other tasks should be sent to the `generic` queue. + +You can decide which queue to send tasks to by using the `queue` parameter of the +`thread.run` functions. Some other operators who also use threads can have a similar +parameter such as `queue_name` for `request.dynamic` and `playlist`. + +```{.liquidsoap include="task-with-queue.liq"} + +``` + +You can also define your own named queue using the `settings.scheduler.queues` setting. +This is particularly useful for two applications: + +- To control concurrent execution of specific tasks. +- To prevent deadlocks in cases some tasks depends on other tasks. + +Typically, `autocue` data resolution is executed inside a `request` resolution. To +control the concurrency with which this CPU-intensive task is executed, we place them +in specific queues. The number of queues controls how many of these tasks can be executed +concurrently. + +Also, this prevents a deadlock where all the request resolution fill up the available +`generic` queues, making it impossible for the autocue computation to finish, thus preventing +the request resolution from returning. diff --git a/doc/dune.inc b/doc/dune.inc index 0f1f2fdff0..eab98186d9 100644 --- a/doc/dune.inc +++ b/doc/dune.inc @@ -167,6 +167,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -295,6 +297,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -423,6 +427,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -551,6 +557,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -679,6 +687,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -807,6 +817,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -935,6 +947,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1063,6 +1077,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1191,6 +1207,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1319,6 +1337,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1447,6 +1467,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1575,6 +1597,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1703,6 +1727,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1831,6 +1857,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -1959,6 +1987,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2087,6 +2117,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2215,6 +2247,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2343,6 +2377,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2471,6 +2507,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2599,6 +2637,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2727,6 +2767,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2855,6 +2897,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -2983,6 +3027,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3111,6 +3157,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3239,6 +3287,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3367,6 +3417,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3495,6 +3547,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3623,6 +3677,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3751,6 +3807,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -3879,6 +3937,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4007,6 +4067,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4135,6 +4197,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4263,6 +4327,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4391,6 +4457,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4519,6 +4587,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4647,6 +4717,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4775,6 +4847,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -4903,6 +4977,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5031,6 +5107,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5159,6 +5237,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5287,6 +5367,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5415,6 +5497,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5543,6 +5627,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5671,6 +5757,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5799,6 +5887,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -5927,6 +6017,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6055,6 +6147,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6183,6 +6277,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6311,6 +6407,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6439,6 +6537,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6567,6 +6667,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6695,6 +6797,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6823,6 +6927,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -6951,6 +7057,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7079,6 +7187,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7207,6 +7317,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7335,6 +7447,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7463,6 +7577,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7591,6 +7707,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7719,6 +7837,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7847,6 +7967,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -7975,6 +8097,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8103,6 +8227,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8231,6 +8357,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8359,6 +8487,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8487,6 +8617,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8615,6 +8747,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8743,6 +8877,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8871,6 +9007,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -8999,6 +9137,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -9025,6 +9165,136 @@ ) ) +(rule + (alias doc) + (package liquidsoap) + (enabled_if (not %{bin-available:pandoc})) + (deps (:no_pandoc no-pandoc)) + (target threads.html) + (action (run cp %{no_pandoc} %{target})) +) + +(rule + (alias doc) + (package liquidsoap) + (enabled_if %{bin-available:pandoc}) + (deps + liquidsoap.xml + language.dtd + template.html + content/liq/append-silence.liq + content/liq/archive-cleaner.liq + content/liq/basic-radio.liq + content/liq/beets-amplify.liq + content/liq/beets-protocol-short.liq + content/liq/beets-protocol.liq + content/liq/beets-source.liq + content/liq/blank-detect.liq + content/liq/blank-sorry.liq + content/liq/complete-case.liq + content/liq/cross.custom.liq + content/liq/crossfade.liq + content/liq/decoder-faad.liq + content/liq/decoder-flac.liq + content/liq/decoder-metaflac.liq + content/liq/dump-hourly.liq + content/liq/dump-hourly2.liq + content/liq/dynamic-source.liq + content/liq/external-output.file.liq + content/liq/fallback.liq + content/liq/ffmpeg-filter-dynamic-volume.liq + content/liq/ffmpeg-filter-flanger-highpass.liq + content/liq/ffmpeg-filter-hflip.liq + content/liq/ffmpeg-filter-hflip2.liq + content/liq/ffmpeg-filter-parallel-flanger-highpass.liq + content/liq/ffmpeg-live-switch.liq + content/liq/ffmpeg-relay-ondemand.liq + content/liq/ffmpeg-relay.liq + content/liq/ffmpeg-shared-encoding-rtmp.liq + content/liq/ffmpeg-shared-encoding.liq + content/liq/fixed-time1.liq + content/liq/fixed-time2.liq + content/liq/frame-size.liq + content/liq/harbor-auth.liq + content/liq/harbor-dynamic.liq + content/liq/harbor-insert-metadata.liq + content/liq/harbor-metadata.liq + content/liq/harbor-redirect.liq + content/liq/harbor-simple.liq + content/liq/harbor-usage.liq + content/liq/harbor.http.register.liq + content/liq/harbor.http.response.liq + content/liq/hls-metadata.liq + content/liq/hls-mp4.liq + content/liq/http-input.liq + content/liq/icy-update.liq + content/liq/input.mplayer.liq + content/liq/jingle-hour.liq + content/liq/json-ex.liq + content/liq/json-stringify.liq + content/liq/json1.liq + content/liq/live-switch.liq + content/liq/medialib-predicate.liq + content/liq/medialib.liq + content/liq/medialib.sqlite.liq + content/liq/multitrack-add-video-track.liq + content/liq/multitrack-add-video-track2.liq + content/liq/multitrack-default-video-track.liq + content/liq/multitrack.liq + content/liq/multitrack2.liq + content/liq/multitrack3.liq + content/liq/output.file.hls.liq + content/liq/playlists.liq + content/liq/prometheus-callback.liq + content/liq/prometheus-settings.liq + content/liq/radiopi.liq + content/liq/re-encode.liq + content/liq/regular.liq + content/liq/replaygain-metadata.liq + content/liq/replaygain-playlist.liq + content/liq/request.dynamic.liq + content/liq/rtmp.liq + content/liq/samplerate3.liq + content/liq/scheduling.liq + content/liq/seek-telnet.liq + content/liq/settings.liq + content/liq/shoutcast.liq + content/liq/single.liq + content/liq/source-cue.liq + content/liq/space_overhead.liq + content/liq/split-cue.liq + content/liq/sqlite.liq + content/liq/srt-receiver.liq + content/liq/srt-sender.liq + content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq + content/liq/transcoding.liq + content/liq/video-anonymizer.liq + content/liq/video-bluescreen.liq + content/liq/video-canvas-example.liq + content/liq/video-default-canvas.liq + content/liq/video-in-video.liq + content/liq/video-logo.liq + content/liq/video-osc.liq + content/liq/video-simple.liq + content/liq/video-static.liq + content/liq/video-text.liq + content/liq/video-transition.liq + content/liq/video-weather.liq + content/liq/video-webcam.liq + (:md content/threads.md) + ) + (target threads.html) + (action + (pipe-stdout + (run pandoc %{md} -t json) + (run pandoc-include --directory content/liq) + (run pandoc -f json --syntax-definition=liquidsoap.xml --highlight=pygments --metadata pagetitle=threads --template=template.html -o %{target}) + ) + ) +) + (rule (alias doc) (package liquidsoap) @@ -9127,6 +9397,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -9255,6 +9527,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -9383,6 +9657,8 @@ content/liq/srt-receiver.liq content/liq/srt-sender.liq content/liq/switch-show.liq + content/liq/task-example.liq + content/liq/task-with-queue.liq content/liq/transcoding.liq content/liq/video-anonymizer.liq content/liq/video-bluescreen.liq @@ -10259,6 +10535,26 @@ (action (run %{bin:liquidsoap} --check --no-fallible-check content/liq/switch-show.liq)) ) +(rule + (alias doctest) + (package liquidsoap) + (deps + (source_tree ../src/libs) + (:test_liq content/liq/task-example.liq) + ) + (action (run %{bin:liquidsoap} --check --no-fallible-check content/liq/task-example.liq)) +) + +(rule + (alias doctest) + (package liquidsoap) + (deps + (source_tree ../src/libs) + (:test_liq content/liq/task-with-queue.liq) + ) + (action (run %{bin:liquidsoap} --check --no-fallible-check content/liq/task-with-queue.liq)) +) + (rule (alias doctest) (package liquidsoap) @@ -10494,6 +10790,7 @@ (stereotool.html as html/stereotool.html) (stream_content.html as html/stream_content.html) (strings_encoding.html as html/strings_encoding.html) + (threads.html as html/threads.html) (video-static.html as html/video-static.html) (video.html as html/video.html) (yaml.html as html/yaml.html)