Friday, September 13, 2019

subscription spool safeguard to avoid memory mismanagement and exponentially ballooning trips to the API

Following up on this, if a spooled piece of data needs another piece of data which will also put something on the spool, you don't want to put the second item on the spool over and over again, right? You would end up with something akin to an n+1 problem only in the API space. If the act to putting to the spool sits inside of another subscription, naturally there is that danger. You probably want a safeguard like so:

if (this.subscriptions.length == 1) {

 
 

If things get really crazy (complex) I guess checking a number won't be enough. You will have to have boolean flags for if subscriptions are yet set.

No comments:

Post a Comment