Skip to content

Commit

Permalink
docs(NODE-3481): deprecate unref (#2936)
Browse files Browse the repository at this point in the history
  • Loading branch information
andymina committed Aug 12, 2021
1 parent fbdc7c8 commit cc0cc20
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/core/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class Connection extends EventEmitter {
* Unref this connection
* @method
* @return {boolean}
* @deprecated This function is deprecated and will be removed in the next major version.
*/
unref() {
if (this.socket == null) {
Expand Down
1 change: 1 addition & 0 deletions lib/core/connection/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ Pool.prototype.logout = function(dbName, callback) {
/**
* Unref the pool
* @method
* @deprecated This function is deprecated and will be removed in the next major version.
*/
Pool.prototype.unref = function() {
// Get all the known connections
Expand Down
5 changes: 4 additions & 1 deletion lib/core/sdam/topology.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,11 @@ class Topology extends EventEmitter {
return this.s.state === STATE_CLOSED;
}

/**
* @deprecated This function is deprecated and will be removed in the next major version.
*/
unref() {
emitWarning('not implemented: `unref`');
emitWarning('`unref` is a noop and will be removed in the next major version');
}

// NOTE: There are many places in code where we explicitly check the last isMaster
Expand Down
1 change: 1 addition & 0 deletions lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ Db.prototype.indexInformation = function(name, options, callback) {
/**
* Unref all sockets
* @method
* @deprecated This function is deprecated and will be removed in the next major version.
*/
Db.prototype.unref = function() {
this.s.topology.unref();
Expand Down

0 comments on commit cc0cc20

Please sign in to comment.