Playout scheduler woos
This project is a quite a difficult cookie to crumble since there is a decent amount of complexity to it which isn’t always ideal for the dev time. But to go over my woos.
So the scheduler
This part is probably one of the most difficult? It’s a mostly logic based module which does an augmentation of SQL and some “go-cron” jobs in order to do scheduling. Does sound a bit wierd but the general idea is that the scheduler module can keep a cache of the next 5 set of programmes in its memory for when its supposed to be played out so it can trigger VT to start a player and then trigger piper to switch it’s inputs ensuring that everything runs on time and I don’t need to have a mainloop that runs around once a second or so, instead begin 5 minutes to live or something. My bone to pick here is error handling since currently VT can’t cancel jobs and there are many possible ways to handle errors depending on what the scoop is.
The other part of this module is the subroutine / validation part ensuring that there is no dead-air on linear channels. This is essentially checking the schedule block’s DB and ensuring that there isn’t any gaps between the blocks and that we’ve got one long playout. This problem can be reduced down to the gaps and islands problem so luckily there is some nice resources on resolving it. But I suppose my main issue with this area is that it is quite SQL based and is currently involving some queries which are a bit unknown to me right now, utilising things like OVER()
, it might actually be quite a basic thing but right now it’s just a bit annoying. Hopefully as I’m fleshing it out more I’ll get to grips with it.
But at least one good thing about the project in general is the refactoring of the schema, it’s gone through a couple of iterations now and I think I’m understanding what I’m after more and it’s becomer a bit more clearer now. Still will probably see more iterations to come but hopefully it’ll end up all cash-money in the end. Also, the comments in the sql are pretty good as well, so quite a happy bunny about that. :)