Skip to content

Commit

Permalink
chore: bump uWebSockets version
Browse files Browse the repository at this point in the history
  • Loading branch information
thaaddeus committed Mar 7, 2024
1 parent 19df122 commit a34790d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "tardis-machine",
"version": "3.28.0",
"engines": {
"node": ">=12"
"node": ">=16"
},
"description": "Locally runnable server with built-in data caching, providing both tick-level historical and consolidated real-time cryptocurrency market data via HTTP and WebSocket APIs",
"main": "dist/index.js",
Expand Down Expand Up @@ -60,7 +60,7 @@
"find-my-way": "^6.3.0",
"is-docker": "^2.2.1",
"tardis-dev": "^13.28.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.10.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.42.0",
"yargs": "^17.5.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions src/tardismachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class TardisMachine {
context
)
},
open: (ws: WebSocket) => {
open: (ws: any) => {
const path = ws.req.getUrl().toLocaleLowerCase()
ws.closed = false
const matchingRoute = wsRoutes[path]
Expand All @@ -66,13 +66,13 @@ export class TardisMachine {
}
},

message: (ws: WebSocket, message: ArrayBuffer) => {
message: (ws: any, message: ArrayBuffer) => {
if (ws.onmessage !== undefined) {
ws.onmessage(message)
}
},

close: (ws: WebSocket) => {
close: (ws: any) => {
ws.closed = true
if (ws.onclose !== undefined) {
ws.onclose()
Expand Down
4 changes: 2 additions & 2 deletions src/ws/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SubscriptionMapper, subscriptionsMappers } from './subscriptionsmappers
const replaySessions: { [sessionKey: string]: ReplaySession | undefined } = {}
let sessionsCounter = 0

export function replayWS(ws: WebSocket, req: HttpRequest) {
export function replayWS(ws: any, req: HttpRequest) {
const parsedQuery = qs.decode(req.getQuery())
const from = parsedQuery['from'] as string
const to = parsedQuery['to'] as string
Expand Down Expand Up @@ -173,7 +173,7 @@ class WebsocketConnection {
private readonly _subscriptionsMapper: SubscriptionMapper
public subscriptionsCount = 0

constructor(public readonly ws: WebSocket, exchange: Exchange, from: string, to: string) {
constructor(public readonly ws: any, exchange: Exchange, from: string, to: string) {
this.replayOptions = {
exchange,
from,
Expand Down
2 changes: 1 addition & 1 deletion src/ws/replaynormalized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HttpRequest, WebSocket } from 'uWebSockets.js'
import { debug } from '../debug'
import { constructDataTypeFilter, getComputables, getNormalizers, ReplayNormalizedRequestOptions, wait } from '../helpers'

export async function replayNormalizedWS(ws: WebSocket, req: HttpRequest) {
export async function replayNormalizedWS(ws: any, req: HttpRequest) {
let messages: AsyncIterableIterator<any> | undefined
try {
const startTimestamp = new Date().getTime()
Expand Down
2 changes: 1 addition & 1 deletion src/ws/streamnormalized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HttpRequest, WebSocket } from 'uWebSockets.js'
import { debug } from '../debug'
import { constructDataTypeFilter, getComputables, getNormalizers, StreamNormalizedRequestOptions, wait } from '../helpers'

export async function streamNormalizedWS(ws: WebSocket, req: HttpRequest) {
export async function streamNormalizedWS(ws: any, req: HttpRequest) {
let messages: AsyncIterableIterator<any> | undefined

try {
Expand Down

0 comments on commit a34790d

Please sign in to comment.