private DisposableBindingBundle <IReadWriteBindingHandle, RetryableWriteContext> CreateReadWriteBindingsAndRetryableWriteContext(ICluster cluster, ICoreSessionHandle sessionHandle, bool async) { var effectiveReadBindings = ChannelPinningHelper.CreateReadWriteBinding(cluster, sessionHandle); var retryableReadContext = CreateRetryableWriteContext(effectiveReadBindings, async); return(new DisposableBindingBundle <IReadWriteBindingHandle, RetryableWriteContext>(effectiveReadBindings, retryableReadContext)); }
private async Task <TResult> ExecuteEndTransactionOnPrimaryAsync <TResult>(IReadOperation <TResult> operation, CancellationToken cancellationToken) { using (var sessionHandle = new NonDisposingCoreSessionHandle(this)) using (var binding = ChannelPinningHelper.CreateReadWriteBinding(_cluster, sessionHandle)) { return(await operation.ExecuteAsync(binding, cancellationToken).ConfigureAwait(false)); } }
private TResult ExecuteEndTransactionOnPrimary <TResult>(IReadOperation <TResult> operation, CancellationToken cancellationToken) { using (var sessionHandle = new NonDisposingCoreSessionHandle(this)) using (var binding = ChannelPinningHelper.CreateReadWriteBinding(_cluster, sessionHandle)) { return(operation.Execute(binding, cancellationToken)); } }
private IWriteBindingHandle CreateReadWriteBinding(IClientSessionHandle session) { return(ChannelPinningHelper.CreateReadWriteBinding(_cluster, session.WrappedCoreSession.Fork())); }