Table of Contents

Class ChannelSourceReadWriteBinding

Namespace
MongoDB.Driver.Core.Bindings
Assembly
MongoDB.Driver.Core.dll

Represents a read-write binding to a channel source.

public sealed class ChannelSourceReadWriteBinding : IReadWriteBinding, IReadBinding, IWriteBinding, IBinding, IDisposable
Inheritance
ChannelSourceReadWriteBinding
Implements
Inherited Members

Constructors

ChannelSourceReadWriteBinding(IChannelSourceHandle, ReadPreference, ICoreSessionHandle)

Initializes a new instance of the ChannelSourceReadWriteBinding class.

public ChannelSourceReadWriteBinding(IChannelSourceHandle channelSource, ReadPreference readPreference, ICoreSessionHandle session)

Parameters

channelSource IChannelSourceHandle

The channel source.

readPreference ReadPreference

The read preference.

session ICoreSessionHandle

The session.

Properties

ReadPreference

Gets the read preference.

public ReadPreference ReadPreference { get; }

Property Value

ReadPreference

The read preference.

Session

Gets the session.

public ICoreSessionHandle Session { get; }

Property Value

ICoreSessionHandle

The session.

Methods

Dispose()

public void Dispose()

GetReadChannelSource(CancellationToken)

Gets a channel source for read operations.

public IChannelSourceHandle GetReadChannelSource(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

IChannelSourceHandle

A channel source.

GetReadChannelSourceAsync(CancellationToken)

Gets a channel source for read operations.

public Task<IChannelSourceHandle> GetReadChannelSourceAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IChannelSourceHandle>

A channel source.

GetWriteChannelSource(IMayUseSecondaryCriteria, CancellationToken)

Gets a channel source for write operations that may use a secondary.

public IChannelSourceHandle GetWriteChannelSource(IMayUseSecondaryCriteria mayUseSecondary, CancellationToken cancellationToken)

Parameters

mayUseSecondary IMayUseSecondaryCriteria

The may use secondary criteria.

cancellationToken CancellationToken

The cancellation token.

Returns

IChannelSourceHandle

A channel source.

GetWriteChannelSource(CancellationToken)

Gets a channel source for write operations.

public IChannelSourceHandle GetWriteChannelSource(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

IChannelSourceHandle

A channel source.

GetWriteChannelSourceAsync(IMayUseSecondaryCriteria, CancellationToken)

Gets a channel source for write operations that may use a secondary.

public Task<IChannelSourceHandle> GetWriteChannelSourceAsync(IMayUseSecondaryCriteria mayUseSecondary, CancellationToken cancellationToken)

Parameters

mayUseSecondary IMayUseSecondaryCriteria

The may use secondary criteria.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IChannelSourceHandle>

A channel source.

GetWriteChannelSourceAsync(CancellationToken)

Gets a channel source for write operations.

public Task<IChannelSourceHandle> GetWriteChannelSourceAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IChannelSourceHandle>

A channel source.