Table of Contents

Class RetryableWriteContext

Namespace
MongoDB.Driver.Core.Operations
Assembly
MongoDB.Driver.Core.dll

Represents a context for retryable writes.

public sealed class RetryableWriteContext : IDisposable
Inheritance
RetryableWriteContext
Implements
Inherited Members

Constructors

RetryableWriteContext(IWriteBinding, bool)

Initializes a new instance of the RetryableWriteContext class.

public RetryableWriteContext(IWriteBinding binding, bool retryRequested)

Parameters

binding IWriteBinding

The binding.

retryRequested bool

if set to true the operation can be retried.

See Also

Properties

Binding

Gets the binding.

public IWriteBinding Binding { get; }

Property Value

IWriteBinding

The binding.

See Also

Channel

Gets the channel.

public IChannelHandle Channel { get; }

Property Value

IChannelHandle

The channel.

See Also

ChannelSource

Gets the channel source.

public IChannelSourceHandle ChannelSource { get; }

Property Value

IChannelSourceHandle

The channel source.

See Also

RetryRequested

Gets a value indicating whether the operation can be retried.

public bool RetryRequested { get; }

Property Value

bool

true if the operation can be retried; otherwise, false.

See Also

Methods

Create(IWriteBinding, bool, CancellationToken)

Creates and initializes a retryable write operation context.

public static RetryableWriteContext Create(IWriteBinding binding, bool retryRequested, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

retryRequested bool

if set to true [retry requested].

cancellationToken CancellationToken

The cancellation token.

Returns

RetryableWriteContext

A retryable write context.

See Also

CreateAsync(IWriteBinding, bool, CancellationToken)

Creates and initializes a retryable write operation context.

public static Task<RetryableWriteContext> CreateAsync(IWriteBinding binding, bool retryRequested, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

retryRequested bool

if set to true [retry requested].

cancellationToken CancellationToken

The cancellation token.

Returns

Task<RetryableWriteContext>

A retryable write context.

See Also

DisableRetriesIfAnyWriteRequestIsNotRetryable(IEnumerable<WriteRequest>)

Disables retries.

public void DisableRetriesIfAnyWriteRequestIsNotRetryable(IEnumerable<WriteRequest> requests)

Parameters

requests IEnumerable<WriteRequest>

The requests.

See Also

Dispose()

public void Dispose()
See Also

ReplaceChannel(IChannelHandle)

Replaces the channel.

public void ReplaceChannel(IChannelHandle channel)

Parameters

channel IChannelHandle

The channel.

See Also

ReplaceChannelSource(IChannelSourceHandle)

Replaces the channel source.

public void ReplaceChannelSource(IChannelSourceHandle channelSource)

Parameters

channelSource IChannelSourceHandle

The channel source.

See Also

See Also