4

I am building a Django app where a function needs to be called asynchronously. I need to handle any interruptions like loss of internet connectivity during that time. How do I achieve this? Can anyone help?

Comments
  • 2
    Loss of connectivity between the server and a third party or between the client and the server?
  • 2
    @lucaspar between the server and the client
  • 0
    So, are you using websockets for that? If not how are the requests being handled?
  • 0
    @lucaspar No as of now the requests are handled as usual HTTP requests in Django rest framework.
  • 2
    @deeaarbee you'll probably want to create a session between client and server (check websockets and polling) as regular http requests are kinda limited for real time communications like status updates and connectivity. Alternatively you can send periodical ping requests (a heartbeat) to your server with a client ID or auth token.
  • 0
    @lucaspar Does celery is anyway related to this scenario?. Should I learn to use Celery or rabbitmq or something like that?. The point is i dont know about these technologies and i dont know which one is suitable for this situation.
  • 0
    @deeaarbee I don't know these tools you mentioned. There are different ways of achieving what you want. I'd recommend you try to express the essence of what you want (like establish a client-server connection) and look for ways to do that (like websockets or polling) and study these so you know what you can do with them.
  • 0
    I know rabbitmq is for message queuing, so I don't know how it'd help you with that, unless you want to do some kind of post processing or send processing intensive orders.
Add Comment