Hacker News new | ask | show | jobs
by Rapzid 1756 days ago
Agree; could be very helpful if somebody not fam with token buckets arrives at this code for some reason and needs to make sense of it. Also, I think one person's "what" is another person's "why":

> if self.one_time_burst > 0 {

What is this code doing? It's setting up a flow control statement. It's dereferencing the "one_time_burst" property on the object self and comparing the value to 0. If the value is greater than 0, it will execute the proceeding code block.

Why is this being done?

> [to] consume the one-time-burst budget.