Search in sources :

Example 1 with AsyncReadWriteBinding

use of com.mongodb.internal.binding.AsyncReadWriteBinding in project mongo-java-driver by mongodb.

the class ClusterFixture method getAsyncBinding.

public static AsyncReadWriteBinding getAsyncBinding(final Cluster cluster, final ReadPreference readPreference) {
    if (!asyncBindingMap.containsKey(readPreference)) {
        AsyncReadWriteBinding binding = new AsyncClusterBinding(cluster, readPreference, ReadConcern.DEFAULT, getServerApi(), IgnorableRequestContext.INSTANCE);
        if (serverVersionAtLeast(3, 6)) {
            binding = new AsyncSessionBinding(binding);
        }
        asyncBindingMap.put(readPreference, binding);
    }
    return asyncBindingMap.get(readPreference);
}
Also used : AsyncReadWriteBinding(com.mongodb.internal.binding.AsyncReadWriteBinding) AsyncClusterBinding(com.mongodb.internal.binding.AsyncClusterBinding) AsyncSessionBinding(com.mongodb.internal.binding.AsyncSessionBinding)

Aggregations

AsyncClusterBinding (com.mongodb.internal.binding.AsyncClusterBinding)1 AsyncReadWriteBinding (com.mongodb.internal.binding.AsyncReadWriteBinding)1 AsyncSessionBinding (com.mongodb.internal.binding.AsyncSessionBinding)1