allanbank / mongodb-async-driver

The MongoDB Asynchronous Java Driver.
Apache License 2.0
22 stars 15 forks source link

Durability MAJORITY_MODE #25

Open igreenfield opened 8 years ago

igreenfield commented 8 years ago

How I use the MAJORITY_MODE?

allanbank commented 8 years ago

You will need to create the durability using the Durability.replicaDurable(String waitForReplicasByMode, int waitTimeoutMillis)method. The value for the waitForReplicasByMode parameter is available viaDurability.MAJORITY_MODE`. The timeout value you will need to adjust for your projects needs.

The driver cannot provide a static for a majority mode Durability because what is a completely reasonable timeout for one project could be ridiculously too long (or short) for another project.