openOrCreate

abstract suspend fun openOrCreate(uniqueName: String, ttl: <Error class: unknown class> = Duration.INFINITE): SyncStream

Open existing SyncStream by unique name or create a new one if specified name does not exist.

Return

Opened or created SyncStream.

Parameters

uniqueName

Unique name to find existing stream or to assign to new stream upon creation.

ttl

Time to live from now or Duration.INFINITE to indicate no expiry.

Throws

TwilioException

When error occurred while stream opening or creation.