I have a ruby service that keeps running forever and I wonder whats the cost of recursivity. When I ctrl-c the service after some time, I get the following error printed:
^Cff.rb:169:in `sleep': Interrupt
from ff.rb:169:in `fetch'
from ff.rb:170:in `fetch'
from ff.rb:187:in `fetch'
from ff.rb:180:in `fetch'
from ff.rb:170:in `fetch'
from ff.rb:187:in `fetch'
from ff.rb:177:in `fetch'
from ff.rb:170:in `fetch'
.... and continue for each recursive call
This makes me wonder if this has a memory cost or if it eventually will fail? Is it bad to use recursive in Ruby like this? Would another solution be better? Ty.