api3dao / commons

Common utilities, modules and configurations used in API3 projects
MIT License
0 stars 2 forks source link

Use return value from the callback as a means to stop the loop in runInLoop #113

Closed Siegrift closed 1 month ago

Siegrift commented 1 month ago

Currently, the runInLoop callback is executed forever, which is not nice, because some use cases require us to loop a certain function forever until some condition happens. It makes sense for the callback to signal this. I guess the response could be shouldContinueRunning, e.g. returning false from the callback will stop the loop.