Skip to content

Commit cc0cc20

Browse files
authored
docs(NODE-3481): deprecate unref (#2936)
1 parent fbdc7c8 commit cc0cc20

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

lib/core/connection/connection.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class Connection extends EventEmitter {
190190
* Unref this connection
191191
* @method
192192
* @return {boolean}
193+
* @deprecated This function is deprecated and will be removed in the next major version.
193194
*/
194195
unref() {
195196
if (this.socket == null) {

lib/core/connection/pool.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ Pool.prototype.logout = function(dbName, callback) {
604604
/**
605605
* Unref the pool
606606
* @method
607+
* @deprecated This function is deprecated and will be removed in the next major version.
607608
*/
608609
Pool.prototype.unref = function() {
609610
// Get all the known connections

lib/core/sdam/topology.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,11 @@ class Topology extends EventEmitter {
742742
return this.s.state === STATE_CLOSED;
743743
}
744744

745+
/**
746+
* @deprecated This function is deprecated and will be removed in the next major version.
747+
*/
745748
unref() {
746-
emitWarning('not implemented: `unref`');
749+
emitWarning('`unref` is a noop and will be removed in the next major version');
747750
}
748751

749752
// NOTE: There are many places in code where we explicitly check the last isMaster

lib/db.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,7 @@ Db.prototype.indexInformation = function(name, options, callback) {
951951
/**
952952
* Unref all sockets
953953
* @method
954+
* @deprecated This function is deprecated and will be removed in the next major version.
954955
*/
955956
Db.prototype.unref = function() {
956957
this.s.topology.unref();

0 commit comments

Comments
 (0)