MCPcopy Create free account
hub / github.com/angular/dev-infra / send

Method send

github-actions/browserstack/set-browserstack-env.js:18387–18420  ·  view source on GitHub ↗

* @see https://websockets.spec.whatwg.org/#dom-websocket-send * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data

(data)

Source from the content-addressed store, hash-verified

18385 var require_sender = __commonJS({
18386 ""(exports, module) {
18387 "use strict";
18388 var { WebsocketFrameSend } = require_frame();
18389 var { opcodes, sendHints } = require_constants5();
18390 var FixedQueue = require_fixed_queue();
18391 var FastBuffer = Buffer[Symbol.species];
18392 var _queue, _running, _socket, _run, run_fn;
18393 var SendQueue = class {
18394 constructor(socket) {
18395 __privateAdd(this, _run);
18396 /**
18397 * @type {FixedQueue}
18398 */
18399 __privateAdd(this, _queue, new FixedQueue());
18400 /**
18401 * @type {boolean}
18402 */
18403 __privateAdd(this, _running, false);
18404 /** @type {import('node:net').Socket} */
18405 __privateAdd(this, _socket, void 0);
18406 __privateSet(this, _socket, socket);
18407 }
18408 add(item, cb, hint) {
18409 if (hint !== sendHints.blob) {
18410 const frame = createFrame(item, hint);
18411 if (!__privateGet(this, _running)) {
18412 __privateGet(this, _socket).write(frame, cb);
18413 } else {
18414 const node2 = {
18415 promise: null,
18416 callback: cb,
18417 frame
18418 };
18419 __privateGet(this, _queue).push(node2);
18420 }
18421 return;
18422 }
18423 const node = {

Callers

nothing calls this directly

Calls 7

isConnectingFunction · 0.70
isEstablishedFunction · 0.70
isClosingFunction · 0.70
__privateSetFunction · 0.70
__privateGetFunction · 0.70
isBlobLikeFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected