I wanted to create an application with a supervisor with children processes that read from a file. In order to remember the last read pointer in the file, I would like to keep the file open.
Also, I want to limit the number of children processes so that the supervisor cannot add more than N children. If there is a request to read from the new file, the supervisor must send kill signal to the process that holds the file pointer to least recently read file.
How would I go about doing something like this in Elixir?