Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use Multiple Websocket Client with your great package? #6

Open
godtaehee opened this issue Oct 10, 2022 · 2 comments
Open

Comments

@godtaehee
Copy link

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I import two WebSocketModule in each different module like below code.

// upbit.module.ts
import { Module } from '@nestjs/common';
import { UpbitService } from './upbit.service';
import { WebSocketModule } from 'nestjs-websocket';
import { UpbitWebsocketClient } from './upbitWebsocketClient';

@Module({
  imports: [
    WebSocketModule.forRoot({
      url: 'wss://api.upbit.com/websocket/v1',
    }),
  ],
  providers: [UpbitService, UpbitWebsocketClient],
  exports: [UpbitWebsocketClient],
})
export class UpbitModule {}
// binance.module.ts
import { Module } from '@nestjs/common';
import { WebSocketModule } from 'nestjs-websocket';
import { BinanceService } from './binance.service';
import { BinanceWebsocketClient } from './binanceWebsocketClient';

@Module({
  imports: [
    WebSocketModule.forRoot({
      url: 'wss://stream.binance.com:9443/ws/btcusdt@trade',
    }),
  ],
  providers: [BinanceService, BinanceWebsocketClient],
  exports: [BinanceWebsocketClient],
})
export class BinanceModule {}

Expected behavior

I expected that I can use both websocket clients because I imported two websocket clients which have different url in each module(upbit.module, binance.module).

But I can only use binance websocket client.

Minimal reproduction of the problem with instructions

I don't have it.

What is the motivation / use case for changing the behavior?

We can get the information from many different WebSocket Clients.

Environment


Nest version: X.Y.Z
Nest WebSocket: X.Y.Z

 
For Tooling issues:
- Node version: v16.16.0
- Platform: Mac
- Server: Express

Others:

@vadimoarturo
Copy link

Up!
The problem is that one token is locked on the provider, and then the token injection is hidden behind the decorator

image
image

@0xslipk
Copy link
Member

0xslipk commented Jan 10, 2023

I will take a look an release a version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants