lloyd / node-toobusy

Build Node.JS servers that don't fall over.
1.3k stars 128 forks source link

Remove native code for Node >= 0.9.1 #17

Open STRML opened 11 years ago

STRML commented 11 years ago

I'm a big fan of this project and have used it a few times. I noticed a few users having issues running it in restricted environments so I spent some time considering a JS-only version. As it turns out, since the addition of Timers.unref() in 0.9.1, we can safely unref the interval timer which will no longer keep the server open.

In this pull request is a full conversion to a JS-only module as well as a few example fixes. All tests pass and the results are identical, with one small behavior change; the C module would start measuring lag after the first tick (from 500ms onward), while this module starts measuring lag on the first tick.

lloyd commented 11 years ago

this is deep. I like simple. I need more time to review it.

Ognian commented 11 years ago

Any news on this? I had some problems with the native implementation on OSX so before digging into this it would be nice to know if a js only implementation works … Thanks Ognian

STRML commented 11 years ago

It works - feel free to use it. On Oct 2, 2013 6:45 PM, "Ognian" notifications@github.com wrote:

Any news on this? I had some problems with the native implementation on OSX so before digging into this it would be nice to know if a js only implementation works … Thanks Ognian

— Reply to this email directly or view it on GitHubhttps://github.com/lloyd/node-toobusy/pull/17#issuecomment-25529552 .

Ognian commented 11 years ago

Thanks for the info, it would be nice if someone would update the version on npmjs so that install via npm gets possible… Thanks Ognian

asilvas commented 11 years ago

@lloyd Any intention of merging this? Code looks solid and would remove a lot of build issues. Being most of the overhead is in networking code, cannot imagine the difference between native and JS will make any measurable difference.

Ognian commented 10 years ago

OK it looks like @lloyd doesn't maintain this anymore... @STRML can you add your version under a different name to npm so that we can start using this?

STRML commented 10 years ago

@Ognian I went ahead and published the module under the name toobusy-js.

Ognian commented 10 years ago

@STRML Thank you!

pocesar commented 10 years ago

@STRML can you enable issues in your repo since its a new version of toobusy?

STRML commented 10 years ago

@pocesar Just added them.

pocesar commented 10 years ago

:+1:

jacobh0 commented 10 years ago

:+1: