addyosmani / addyosmani/essential-js-design-patterns
question: design pattern to avoid memory leaks
- 主要言語
- HTML
- スター
- 4.9k
- フォーク
- 804
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi @addyosmani ,
Your design pattern book is awesome. I am working with nodejs and need some advice on scenarios like below:
Lets say i have a function that makes persistent tcp connection to say twitter and does all the parsing on that.
Eg:
```
function addTwitter(somedata) {
var twit = new Twitter(somedata);
twit.on('twit', function(err,data) {
//do something here
// use somedata variable here.
}
}
addTwitter(somehandle);
addTwitter(anotherhandle);
```
so basically this addTwitter is used to make multiple connections to twitter server.
I am wondering if this style will leak memory. Also, If there is a better way of doing this.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。