httpcat | simple utility for constructing raw HTTP requests | Command Line Interface library
kandi X-RAY | httpcat Summary
kandi X-RAY | httpcat Summary
httpcat is a simple utility for constructing raw HTTP requests on the command line.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Concatenate HTTP headers .
- Finalize options .
- Main entry point .
- Run tests .
httpcat Key Features
httpcat Examples and Code Snippets
Community Discussions
Trending Discussions on httpcat
QUESTION
I want to know if it is necessary to unsubscribe from Observables made with forkJoin([..])
using a set of HttpClient Observables piped by shareReplay(..)
operator?
I read about forkJoin(..)
that it unsubscribe automatically, but i don't know if it's the same case when piped with shareReplay(..)
operator, because i read that this one can leads to a Memory Leaks problems if it's misused.
My following example is used to cache Http Requests results and here is my chunk of codes:
Service:
...ANSWER
Answered 2022-Mar-23 at 20:34I think that the use of forkJoin
together with shareReplay
does not cause any memory leak issue. The reason is the following:
forkJoin
notifies when all the Observables passed in as parameterscomplete
. In this case, since the Observable passed toforkJoin
are related to http calls, they complete just after the http call returns. therefore as soon as both http calls return, the Observable created byforkJoin
notifies and then completes.- The effect of
shareReplay
is to create an internal cache that makes sure that any subscription will get the last value notified by upstream. In this case, the last value notified by upstream is the only value notified by the Observable created byforkJoin
The risk of memory leaks or, at least, the risk of uncontrolled execution of code with shareRepley
comes when the source Observable is an infinite stream (for instance a stream created with interval
). In this case, shareReplay
creates an Observable which never completes, even if there are no subscribers, unless the refCount
property of ShareReplayConfig
is set to true
.
This behavior is explained in details in the documentation.
In any case this is not a risk you run, since the source Observable you have will emit only once and then complete.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install httpcat
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page