nestjs-websocket icon indicating copy to clipboard operation
nestjs-websocket copied to clipboard

expose ws creation func

Open VargaElod23 opened this issue 2 years ago • 4 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: CONTRIBUTING.md
  • [x] Tests for the changes have been added (for bug fixes / features) -> not necessary as it is only a func exposure
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix

  • [ ] Feature

  • [ ] Code style update (formatting, local variables)

  • [x] Refactoring (no functional changes, no api changes)

  • [ ] Build related changes

  • [ ] CI related changes

  • [x] Other... Please describe:

  • I exposed the ws creation function so that recreating the connection is possible in a module-friendly way. As Nest.JS doesn't support runtime recreation of whole modules this is the only way to instantiate WS connection like the guys asked in #5 . We ran in the same issue, thus the fix. If this method is exposed we can use it on-demand(like onClose just recreate it).

What is the current behavior?

Issue Number: #5 .

What is the new behavior?

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Other information

VargaElod23 avatar Nov 03 '22 11:11 VargaElod23

Can you review the PR please? It would be very interesting use it to implement a reconnect policy when losing the connection to the websocket server.

jmoratat avatar Aug 27 '23 21:08 jmoratat

@JorgeMorata just use https://github.com/Taraxa-project/nestjs-websocket until

VargaElod23 avatar Aug 28 '23 14:08 VargaElod23

@JorgeMorata just use https://github.com/Taraxa-project/nestjs-websocket until

Could you make it platform-agnostic please? ('build' fails due to the 'rm" command). Thank u so much!

jmoratat avatar Aug 30 '23 11:08 jmoratat

@JorgeMorata just use https://github.com/Taraxa-project/nestjs-websocket until

Could you make it platform-agnostic please? ('build' fails due to the 'rm" command). Thank u so much!

@JorgeMorata you can set git bash as default shell for running npm scripts. This will fix the issue with the rm command. Just make sure to enter the right path to your git bash (the one from the linked answer was not suitable for my installation).

LeoLTM avatar Aug 30 '23 12:08 LeoLTM