# ConnectAttempt
Source: https://docs.maelstrom-ai.co/0.2/reference/realtime/interfaces/connectattempt/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

Defined in: packages/realtime/src/lib/connect-race-guard.ts:12

A single `connect()` attempt handed out by [ConnectRaceGuard.begin](https://docs.maelstrom-ai.co/0.2/reference/realtime/classes/connectraceguard/#begin).

A provider adapter’s `connect()` interleaves awaits (token mint, transport join, mic acquisition) with shared-field writes. Between those awaits a `disconnect()` or a newer `connect()` can overtake this one; re-checking the attempt after each await tells the stale winner-loser apart so a superseded attempt abandons its own resources instead of clobbering the winner’s.

## Properties

### isCurrent

> `readonly` **isCurrent**: `boolean`

Defined in: packages/realtime/src/lib/connect-race-guard.ts:19

`true` while no newer `begin()` or `supersede()` has overtaken this attempt. Non-throwing, for cleanup branches (e.g. a `catch` deciding whether to reset shared state) — a superseded attempt must NOT run teardown, which belongs to the winner.

## Methods

### assertCurrent()

> **assertCurrent**(): `void`

Defined in: packages/realtime/src/lib/connect-race-guard.ts:26

Throw [RealtimeVoiceError](https://docs.maelstrom-ai.co/0.2/reference/realtime/classes/realtimevoiceerror/) `CONNECT_SUPERSEDED` if a newer attempt or a teardown overtook this one. Call after each `connect()` await, before publishing to shared fields, so a stale attempt aborts rather than joining a transport nobody owns.

#### Returns

`void`
