nest
nest copied to clipboard
feat(microservices): add local domain transporter
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:
What is the current behavior?
Currently there is no unix socket/named pipe microservice transporter.
What is the new behavior?
This adds new microservice transporter using named pipes on Windows or unix sockets for other operating systems.
This uses node's net module and is copy of TCP transporter changed to support local domain (i.e. unix sockets/named pipes) transport instead of host and port.
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Pull Request Test Coverage Report for Build ce27e432-215c-4f79-97ce-9505a67d0c2d
Details
- 186 of 202 (92.08%) changed or added relevant lines in 13 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage decreased (-0.004%) to 92.204%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| packages/microservices/helpers/local-domain-socket.ts | 29 | 32 | 90.63% |
| packages/microservices/server/server-local-domain.ts | 47 | 52 | 90.38% |
| packages/microservices/client/client-local-domain.ts | 54 | 62 | 87.1% |
| <!-- | Total: | 186 | 202 |
| Totals | |
|---|---|
| Change from base Build d60c66a1-ca4c-4b6a-b0cc-2fd524f244cf: | -0.004% |
| Covered Lines: | 6931 |
| Relevant Lines: | 7517 |
💛 - Coveralls
Your work here is truly fantastic, and we really appreciate your effort. However, we've decided not to add any more 'officially supported' transport strategies to the @nestjs/microservices package. This is because doing so would place the responsibility of maintaining and improving them on our team, and our maintenance workload is already quite heavy.
That said, it would be amazing if you could create a new repository, publish this strategy as an NPM package, and share the link here with the community.
Thanks again for your valuable contribution!