***

title: stop
slug: /reference/python/agents/swml-service/stop
description: Set the internal running flag (does not stop a running Uvicorn server).
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Sets the internal `_running` flag to `False`.

<Warning>
  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.
</Warning>

## **Returns**

`None`

## **Example**

```python {6}
from signalwire.core.swml_service import SWMLService

service = SWMLService(name="my-service")

# In a signal handler or shutdown hook:
service.stop()
```