<!--
{
  "availability" : [

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

# events

Fresh fan-out `AsyncStream` of [`TorEvent`](/documentation/Tor/TorEvent) values.

```
var events: AsyncStream<TorEvent> { get }
```

## Discussion

Every access returns a new subscriber stream; swift-tor
multiplexes each yielded [`TorEvent`](/documentation/Tor/TorEvent) to all live subscribers, so
two consumers see identical sequences. Surfaces:

- ``doc://Tor/documentation/Tor/TorEvent/bootstrap(progress:tag:summary:)`` as
  ``doc://Tor/documentation/Tor/TorClient/waitUntilBootstrapped(timeout:)`` polls.
- ``doc://Tor/documentation/Tor/TorEvent/stateChanged(_:)`` on every ``doc://Tor/documentation/Tor/TorClient/state`` transition.
- ``doc://Tor/documentation/Tor/TorEvent/log(level:message:)``, ``doc://Tor/documentation/Tor/TorEvent/circuit(id:status:)``,
  and ``doc://Tor/documentation/Tor/TorEvent/stream(id:status:target:)`` when the caller has
  subscribed the corresponding raw events via
  ``doc://Tor/documentation/Tor/TorControlClient/subscribe(to:)``.

> Important: Streams have **no replay**. Subscribers that start
> after bootstrap completion will not see prior
> ``doc://Tor/documentation/Tor/TorEvent/bootstrap(progress:tag:summary:)`` values; read
> ``doc://Tor/documentation/Tor/TorClient/state`` for the initial snapshot when opening the iterator.

> Note: The stream completes exactly once, in ``doc://Tor/documentation/Tor/TorClient/stop()``, when
> all continuations are finished.