Skip to content

Instantly share code, notes, and snippets.

View andrew-delph's full-sized avatar

Andrew Delph andrew-delph

  • 23:20 (UTC -04:00)
View GitHub Profile
@andrew-delph
andrew-delph / K6SocketIoBase.ts
Last active July 18, 2024 12:49
A wrapper for the socket io websocket package to give socketio with promises.
import { responseCode, responseType } from './constants';
import { checkResponse, getArrayFromRequest, getCallbackId } from './socket.io';
import { uuidv4 as uuid } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js';
import { setTimeout, clearTimeout } from 'k6/experimental/timers';
import { check } from 'k6';
export abstract class K6SocketIoBase {
socket: any;
callbackCount = 0;