<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorClient/state",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A6ClientC5stateAA0A5StateOvp"
  },
  "title" : "state"
}
-->

# state

Current lifecycle state, isolated to the actor.

```
var state: TorState { get }
```

## Discussion

Reads require `await` to cross the actor boundary; writes happen
only inside [`start()`](/documentation/Tor/TorClient/start()) / [`stop()`](/documentation/Tor/TorClient/stop()) / [`waitUntilBootstrapped(timeout:)`](/documentation/Tor/TorClient/waitUntilBootstrapped(timeout:))
and their helpers. Observers that need near-real-time updates
without polling should consume [`events`](/documentation/Tor/TorClient/events) for
[`TorEvent.stateChanged(_:)`](/documentation/Tor/TorEvent/stateChanged(_:)).

- Stability: follows the transition graph documented on
  ``doc://Tor/documentation/Tor/TorState``; default is ``doc://Tor/documentation/Tor/TorState/idle``.