post(msg, transferable) {
        const req = this.REQS[msg.id];
        const id = msg.id;
        if (req.ws.readyState > 1) {
            delete this.REQS[id];
            throw new Error("Connection closed");
        }
        msg.id = this.REQ_ID_MAP.get(id);
        if (transferable) {
            msg.is_transferable = true;
            req.ws.send(JSON.stringify(msg));
            req.ws.send(transferable[0]);
        } else {
            req.ws.send(JSON.stringify(msg));
        }
        if (!req.msg.subscribe) {
            this.REQ_ID_MAP.delete(id);
            delete this.REQS[id];
        }
    }
/**
     * Send an asynchronous message to the Perspective web worker.
     *
     * If the `transferable` param is set, pass two messages: the string representation of the message and then
     * the ArrayBuffer data that needs to be transferred. The `is_transferable` flag tells the client to expect the next message
     * to be a transferable object.
     *
     * @param {Object} msg a valid JSON-serializable message to pass to the client
     * @param {*} transferable a transferable object to be sent to the client
     */
Send an asynchronous message to the Perspective web worker.

If the `transferable` param is set, pass two messages: the string representation of the message and then
the ArrayBuffer data that needs to be transferred. The `is_transferable` flag tells the client to expect the next message
to be a transferable object.

@param {Object} msg a valid JSON-serializable message to pass to the client
@param {*} transferable a transferable object to be sent to the client
Send an asynchronous message to the Perspective web worker . If the ` transferable ` param is set pass two messages : the string representation of the message and then the ArrayBuffer data that needs to be transferred . The ` is_transferable ` flag tells the client to expect the next message to be a transferable object . @param { Object } msg a valid JSON - serializable message to pass to the client @param { * } transferable a transferable object to be sent to the client
post(msg, transferable) {
        const req = this.REQS[msg.id];
        const id = msg.id;
        if (req.ws.readyState > 1) {
            delete this.REQS[id];
            throw new Error("Connection closed");
        }
        msg.id = this.REQ_ID_MAP.get(id);
        if (transferable) {
            msg.is_transferable = true;
            req.ws.send(JSON.stringify(msg));
            req.ws.send(transferable[0]);
        } else {
            req.ws.send(JSON.stringify(msg));
        }
        if (!req.msg.subscribe) {
            this.REQ_ID_MAP.delete(id);
            delete this.REQS[id];
        }
    }
post ( msg , transferable ) { const req = this . REQS [ msg . id ] ; const id = msg . id ; if ( req . ws . readyState > 1 ) { delete this . REQS [ id ] ; throw new Error ( "Connection closed" ) ; } msg . id = this . REQ_ID_MAP . get ( id ) ; if ( transferable ) { msg . is_transferable = true ; req . ws . send ( JSON . stringify ( msg ) ) ; req . ws . send ( transferable [ 0 ] ) ; } else { req . ws . send ( JSON . stringify ( msg ) ) ; } if ( ! req . msg . subscribe ) { this . REQ_ID_MAP . delete ( id ) ; delete this . REQS [ id ] ; } }
Send an asynchronous message to the Perspective web worker.
Send an asynchronous message to the Perspective web worker .