juntossomosmais/django-stomp

Blocking `on_message`

fabiohk opened this issue · 0 comments

Given that stomp.py provides a synchronous interface using an observer design pattern, if we have a consumer that takes a long time to complete its job, we'll miss some heartbeats frames and when we try to ack the message, we'll find that the connection was closed.

With that issue in mind, why not give django-stomp the possibility to handle on_message's notifications on a background thread, if needed? So, we would have a Listener deciding if it'll block the processing of new frames or not and also handling the threads it created (so if a timeout occur, it should kill any background task that are still running, etc).