I'm making an importer for my own project, where I work with a lot of biology related API's that are all pretty badly optimized. Most endpoints requests can take over a second, I want to optimize this by creating queue's for each source I'm using to fetch data.
So I have a request that fetches data relating the tree of life (the skeleton of the project) that will return the name, the type of node it is: MRCA / Normal (this is domain specific terminology) and children.
Based on name I want to send this through a channel to another importer client that will retrieve context related to this name. So this node with name: Gorilla gorilla gorilla, will return a context descriptor: mammalia . After fetching this context descriptor I making a decision which external sources are interesting to call: wikipedia, encyclopedia of life, silva (for DNA related records), etc. So I was think to make channels for each of these clients as well.
I was thinking of making all channels unbounded because they shouldn't really care if they are behind or not I don't need to block other importers until the current one is done for my use case. But I read that this can run out of memory? I'm not sure how, it should only take up 1 task each time anyway right, and after finishing then it looks for the next one?
So my questions are:
Do I have to bound these channels?
If so what would be a reasonable amount?
Why can an unbounded channel run out of memory when only 1 task is processed each time?