A few months ago, we added a method (add_endpoint
) to BaseService
(see here) that allows you to add any additional endpoints your business logic requires to the process itself. The advantages are:
- If the listen greenlet fails, the failure is noticed and reported up the chain to the process manager. Usually, this will mean your process will terminate.
- You don't need to write any code for cleaning your endpoint up on service/process quit, it happens automatically.
Back in the day, we added start
and stop
methods to Subscriber
endpoints. The goal of which was to make them easier to work with - just call start, and it automatically spawns a greenlet. The issue here is that if this greenlet fails, nothing ever takes notice of it - you just see the error on stdout. This leads to many problems such as consumers not terminating properly, leading to massive queue backup, and stopping bu