apnsagent icon indicating copy to clipboard operation
apnsagent copied to clipboard

Tail recursion in redis subscriber message comsuming

Open hhkbp2 opened this issue 12 years ago • 1 comments

Hi,

When browsing the codes, I notice that there is a tail recursion in file notification.py, line 236. Python is not optimized on tail recursion, unlike most functional programming languages such as lisp or erlang. It could cause memory dilation or even program crash.

hhkbp2 avatar Apr 02 '14 14:04 hhkbp2

hey bro! thanks for your review. Indeed, tail recursion is not the best way to handle the connection error here. But fortunately, the tail recursion is only execute when redis connection error occur, and the recursion time is limited by the variable 'retry_time_max'. Any way, I will refactor it, may be in another language, Thank you and sorry for my tardy reply :)

jeffkit avatar Apr 10 '14 15:04 jeffkit