newclient
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -141,3 +141,5 @@ src/**.js.map
|
|||||||
.env
|
.env
|
||||||
lib
|
lib
|
||||||
src/playground.ts
|
src/playground.ts
|
||||||
|
|
||||||
|
dump.rdb
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { io } from 'socket.io-client';
|
||||||
|
|
||||||
|
const main = async () => {
|
||||||
|
const socket = io('http://localhost:3000');
|
||||||
|
|
||||||
|
socket.on('connect', () => {
|
||||||
|
socket.emit('subscribe', 'SOL-PERP');
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on('SOL-PERP', (data: any) => {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
main().then(() => {
|
||||||
|
console.log('running');
|
||||||
|
});
|
||||||
|
|||||||
@@ -86,12 +86,11 @@ export class DLOBSubscriberIO extends DLOBSubscriber {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
l2Args.updateOnChange &&
|
l2Args.updateOnChange
|
||||||
this.lastSeenL2Formatted
|
|
||||||
.get(l2Args.marketType)
|
|
||||||
?.get(l2Args.marketIndex) === JSON.stringify(l2Formatted)
|
|
||||||
) {
|
) {
|
||||||
return;
|
if (this.lastSeenL2Formatted
|
||||||
|
.get(l2Args.marketType)
|
||||||
|
?.get(l2Args.marketIndex) === JSON.stringify(l2Formatted)) return;
|
||||||
}
|
}
|
||||||
this.lastSeenL2Formatted
|
this.lastSeenL2Formatted
|
||||||
.get(l2Args.marketType)
|
.get(l2Args.marketType)
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ async function main() {
|
|||||||
console.log('Subscribing to channel', channel);
|
console.log('Subscribing to channel', channel);
|
||||||
redisClient.client.subscribe(channel);
|
redisClient.client.subscribe(channel);
|
||||||
redisClient.client.on('message', (subscribedChannel, message) => {
|
redisClient.client.on('message', (subscribedChannel, message) => {
|
||||||
console.log(message);
|
|
||||||
if (subscribedChannel === channel) {
|
if (subscribedChannel === channel) {
|
||||||
socket.emit(channel, JSON.parse(message));
|
socket.emit(channel, JSON.parse(message));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user