@@ -192,9 +192,9 @@ class WebSocket extends EventEmitter {
192192 * @param {Duplex } socket The network socket between the server and client
193193 * @param {Buffer } head The first packet of the upgraded stream
194194 * @param {Object } options Options object
195- * @param {Boolean } [options.allowMultipleEventsPerMicrotask =false] Specifies
196- * whether or not to process more than one of the `'message'`, `'ping'`,
197- * and `'pong'` events per microtask
195+ * @param {Boolean } [options.allowSynchronousEvents =false] Specifies whether
196+ * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted
197+ * multiple times in the same tick
198198 * @param {Function } [options.generateMask] The function used to generate the
199199 * masking key
200200 * @param {Number } [options.maxPayload=0] The maximum allowed message size
@@ -204,7 +204,7 @@ class WebSocket extends EventEmitter {
204204 */
205205 setSocket ( socket , head , options ) {
206206 const receiver = new Receiver ( {
207- allowMultipleEventsPerMicrotask : options . allowMultipleEventsPerMicrotask ,
207+ allowSynchronousEvents : options . allowSynchronousEvents ,
208208 binaryType : this . binaryType ,
209209 extensions : this . _extensions ,
210210 isServer : this . _isServer ,
@@ -622,9 +622,9 @@ module.exports = WebSocket;
622622 * @param {(String|URL) } address The URL to which to connect
623623 * @param {Array } protocols The subprotocols
624624 * @param {Object } [options] Connection options
625- * @param {Boolean } [options.allowMultipleEventsPerMicrotask =false] Specifies
626- * whether or not to process more than one of the `'message'`, `'ping'`,
627- * and `'pong'` events per microtask
625+ * @param {Boolean } [options.allowSynchronousEvents =false] Specifies whether any
626+ * of the `'message'`, `'ping'`, and `'pong'` events can be emitted multiple
627+ * times in the same tick
628628 * @param {Function } [options.finishRequest] A function which can be used to
629629 * customize the headers of each http request before it is sent
630630 * @param {Boolean } [options.followRedirects=false] Whether or not to follow
@@ -649,7 +649,7 @@ module.exports = WebSocket;
649649 */
650650function initAsClient ( websocket , address , protocols , options ) {
651651 const opts = {
652- allowMultipleEventsPerMicrotask : false ,
652+ allowSynchronousEvents : false ,
653653 protocolVersion : protocolVersions [ 1 ] ,
654654 maxPayload : 100 * 1024 * 1024 ,
655655 skipUTF8Validation : false ,
@@ -1001,7 +1001,7 @@ function initAsClient(websocket, address, protocols, options) {
10011001 }
10021002
10031003 websocket . setSocket ( socket , head , {
1004- allowMultipleEventsPerMicrotask : opts . allowMultipleEventsPerMicrotask ,
1004+ allowSynchronousEvents : opts . allowSynchronousEvents ,
10051005 generateMask : opts . generateMask ,
10061006 maxPayload : opts . maxPayload ,
10071007 skipUTF8Validation : opts . skipUTF8Validation
0 commit comments