You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple question for my project with aiocoap. I running the server inside a container (Ubuntu 20.04 as base image). I have binding the server.py file to the container /app folder, and what I want is to setup a Debug mode or some configuration that allow to Live Reload (or Hot Reload) and restart with the new code the CoAP server.
Is there any parameter to setup? In aiocoap or in asyncio library?
Thanks you!
The text was updated successfully, but these errors were encountered:
J0hn3ch
changed the title
How to setup a debug mode on CoAP Server or an Hot Reloading on code changing
How to setup a debug mode on CoAP Server or an Hot Reloading on code changing?
Jun 24, 2024
There is no hot-reloading implemented in aiocoap (or in Python in general that I know of). I usually just stop and restart the server process, there's no notable delay in that, and a CoAP server is largely stateless anyway, and it avoids any of the lingering state issues hot reloading can have.
If you have any third party hot reload tool you are using in your application, you can probably hook aiocoap in with that, but that'll depend on that tool. At any rate, your choices are there to have the aiocoap server running outside (maybe passing requests in, or maybe switching the .site of the handler on reload) or to reload it along with the rest of the code (in which case I recommend you await .shutdown() to ensure that sockets can be reused) -- which of those two you choose depends on what you are changing, and what you expect to work across reloads.
Hi,
I have a simple question for my project with aiocoap. I running the server inside a container (Ubuntu 20.04 as base image). I have binding the server.py file to the container /app folder, and what I want is to setup a Debug mode or some configuration that allow to Live Reload (or Hot Reload) and restart with the new code the CoAP server.
Is there any parameter to setup? In aiocoap or in asyncio library?
Thanks you!
The text was updated successfully, but these errors were encountered: