Skip to content

wait_until_stream_not_exists async

wait_until_stream_not_exists(
    *,
    max_wait_time: float,
    min_delay: float = 10,
    max_delay: float = 120,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_name: Optional[StreamName] = None,
    limit: Optional[DescribeStreamInputLimit] = None,
    exclusive_start_shard_id: Optional[ShardId] = None,
    stream_arn: Optional[StreamARN] = None,
    stream_id: Optional[StreamId] = None,
) -> ServiceError

Wait for stream_not_exists.

Parameters:

  • max_wait_time (float) –

    Maximum total seconds to wait before raising WaiterTimeoutError.

  • min_delay (float, default: 10 ) –

    Minimum seconds between operation attempts (spec default 2).

  • max_delay (float, default: 120 ) –

    Maximum seconds between operation attempts (spec default 120).

  • stream_name (Optional[StreamName], default: None ) –

    The name of the stream to describe.

  • limit (Optional[DescribeStreamInputLimit], default: None ) –

    The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

  • exclusive_start_shard_id (Optional[ShardId], default: None ) –

    The shard ID of the shard to start with.

    Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows ExclusiveStartShardId.

    If you don't specify this parameter, the default behavior for DescribeStream is to describe the stream starting with the first shard in the stream.

  • stream_arn (Optional[StreamARN], default: None ) –

    The ARN of the stream.

  • stream_id (Optional[StreamId], default: None ) –

    Not Implemented. Reserved for future use.

Source code in docs_src/capo_kinesis/_services/async_kinesis.py
async def wait_until_stream_not_exists(
    self,
    *,
    max_wait_time: float,
    min_delay: float = 10,
    max_delay: float = 120,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_name: Optional["capo_kinesis.types.stream_name.StreamName"] = None,
    limit: Optional[
        "capo_kinesis.types.describe_stream_input_limit.DescribeStreamInputLimit"
    ] = None,
    exclusive_start_shard_id: Optional[
        "capo_kinesis.types.shard_id.ShardId"
    ] = None,
    stream_arn: Optional["capo_kinesis.types.stream_arn.StreamARN"] = None,
    stream_id: Optional["capo_kinesis.types.stream_id.StreamId"] = None,
) -> ServiceError:
    """Wait for stream_not_exists.

    Args:
        max_wait_time: Maximum total seconds to wait before raising WaiterTimeoutError.
        min_delay: Minimum seconds between operation attempts (spec default 2).
        max_delay: Maximum seconds between operation attempts (spec default 120).
        stream_name: <p>The name of the stream to describe.</p>
        limit: <p>The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
        exclusive_start_shard_id: <p>The shard ID of the shard to start with.</p> <p>Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p> <p>If you don't specify this parameter, the default behavior for <code>DescribeStream</code> is to describe the stream starting with the first shard in the stream.</p>
        stream_arn: <p>The ARN of the stream.</p>
        stream_id: <p>Not Implemented. Reserved for future use.</p>
    """
    start = time.monotonic()
    attempt = 0
    while True:
        op_output: "capo_kinesis.types.describe_stream_output.DescribeStreamOutput | None" = None
        op_error: ServiceError | None = None
        try:
            op_output = await self.describe_stream(  # noqa: F841
                config_overrides=config_overrides,
                stream_name=stream_name,
                limit=limit,
                exclusive_start_shard_id=exclusive_start_shard_id,
                stream_arn=stream_arn,
                stream_id=stream_id,
            )
        except ServiceError as e:
            op_error = e
        if op_error is not None and op_error.code == "ResourceNotFoundException":
            return op_error
        elif op_error is not None:
            raise op_error

        elapsed = time.monotonic() - start
        remaining = max_wait_time - elapsed
        if remaining <= 0:
            raise WaiterTimeoutError("stream_not_exists", max_wait_time)
        delay = min(max_delay, min_delay * (2**attempt))
        delay = random.uniform(min_delay, delay)
        delay = min(delay, remaining)
        await anysleep(delay)
        attempt += 1