diff options
| author | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2018-01-09 13:12:06 -0500 |
|---|---|---|
| committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2018-01-26 16:47:16 -0500 |
| commit | bb5575aa75fd3071724d5eccde39a3041e1af57a (patch) | |
| tree | 78b2dba7b447d2e6a9e3f12348956643473577d4 /lib/net.js | |
| parent | 54fe0a6cbb7b36b8169e7c8dd21dcaeec3da0035 (diff) | |
| download | node-new-timers-internal-refresh.tar.gz | |
timers: add internal [@@ refresh()] functiontimers-internal-refresh
Hidden via a symbol because I'm unsure exactly what the API should look
like in the end.
Removes the need to use _unrefActive for efficiently refreshing
timeouts.
It still uses it under the hood but that could be replaced with
insert() directly if it were in the same file.
PR-URL: https://github.com/nodejs/node/pull/18065
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Diffstat (limited to 'lib/net.js')
| -rw-r--r-- | lib/net.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/net.js b/lib/net.js index 16d0b9605c..41c1cacac5 100644 --- a/lib/net.js +++ b/lib/net.js @@ -23,7 +23,6 @@ const EventEmitter = require('events'); const stream = require('stream'); -const timers = require('timers'); const util = require('util'); const internalUtil = require('internal/util'); const { @@ -64,7 +63,8 @@ const exceptionWithHostPort = util._exceptionWithHostPort; const { kTimeout, setUnrefTimeout, - validateTimerDuration + validateTimerDuration, + refreshFnSymbol } = require('internal/timers'); function noop() {} @@ -291,7 +291,7 @@ util.inherits(Socket, stream.Duplex); Socket.prototype._unrefTimer = function _unrefTimer() { for (var s = this; s !== null; s = s._parent) { if (s[kTimeout]) - timers._unrefActive(s[kTimeout]); + s[kTimeout][refreshFnSymbol](); } }; |
