Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions driver-core/src/main/com/mongodb/event/ClusterListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
/**
* A listener for cluster-related events.
* <p>
* It does not have to be thread-safe. All events received by {@link ClusterListener}, {@link ServerListener},
* All events received by {@link ClusterListener}, {@link ServerListener},
* {@link ServerMonitorListener} are totally ordered (and the event order implies the happens-before order), provided that the listeners
* are not shared by different {@code MongoClient}s. This means that even if you have a single class implementing all of
* {@link ClusterListener}, {@link ServerListener}, {@link ServerMonitorListener}, it does not have to be thread-safe.
* are not shared by different {@code MongoClient}s. This guarantee holds even if you have a single class implementing
* all of {@link ClusterListener}, {@link ServerListener}, {@link ServerMonitorListener}. However, if a listener writes to shared memory,
* the write actions still must be synchronized with read actions from that shared memory,
* if the read actions are done not as part of executing any of the listener methods by a {@code MongoClient}.
* </p>
* @see ServerListener
* @see ServerMonitorListener
Expand Down
2 changes: 1 addition & 1 deletion driver-core/src/main/com/mongodb/event/ServerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* A listener for server-related events
* <p>
* It does not have to be thread-safe, see {@link ClusterListener} for the details regarding the order of events.
* See {@link ClusterListener} for the details regarding the order of events and memory synchronization.
* </p>
* @see ClusterListener
* @see ServerMonitorListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* A listener for server monitor-related events
* <p>
* It does not have to be thread-safe, see {@link ClusterListener} for the details regarding the order of events.
* See {@link ClusterListener} for the details regarding the order of events and memory synchronization.
* </p>
* @see ClusterListener
* @see ServerListener
Expand Down