stop

View as MarkdownOpen in Claude

Sets the internal _running flag to False.

This method does not stop a running Uvicorn server. serve() calls uvicorn.run(), which blocks in its own event loop and never checks _running. To stop the server, send a SIGINT or SIGTERM signal to the process instead.

Returns

None

Example

from signalwire.core.swml_service import SWMLService
service = SWMLService(name="my-service")
# In a signal handler or shutdown hook:
service.stop()