Skip to content

Commit af41d4d

Browse files
docs(microservices) remove installing of rxjs package
1 parent bbf5712 commit af41d4d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

content/microservices/basics.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,29 +354,21 @@ The `data` property is the message payload sent by the message producer. The `pa
354354

355355
Sometimes, microservices are down or not available. You can handle these cases using the `RxJS` timeout operator in the call. If the microservice does not respond to the request within a certain time, an Exception is thrown, which can be caught and handled appropriately.
356356

357-
To solve this problem you have to install [rxjs](https://github.com/ReactiveX/rxjs) package:
358-
359-
```bash
360-
npm install rxjs
361-
```
362-
363-
Then just use the `timeout` operator in the pipe:
357+
To solve this problem you have to use [rxjs](https://github.com/ReactiveX/rxjs) package. Just use the `timeout` operator in the pipe:
364358

365359
```typescript
366360
@@filename()
367-
import { timeout } from 'rxjs/operators';
368-
// ...
369361
this.client
370362
.send<TResult, TInput>(pattern, data)
371363
.pipe(timeout(5000))
372364
.toPromise();
373365
@@switch
374-
import { timeout } from 'rxjs/operators';
375-
// ...
376366
this.client
377367
.send(pattern, data)
378368
.pipe(timeout(5000))
379369
.toPromise();
380370
```
381371

372+
> info **Hint** The `timeout` operator is imported from the `rxjs/operators` package.
373+
382374
After 5 seconds, if the microservice isn't responding, it will throw an error.

0 commit comments

Comments
 (0)