Re: [nodejs] Node Addon: Threads and libuv ref counter (C++)

2012-06-17 Thread wtfux
Ben Noordhuis wrote: > > > uv_thread_create() is your best option but, as you mention, it's not > available in v0.6. > I switched over to uv_queue_work() and uv_thread_create() (depending on NODE_VERSION_AT_LEAST as mention in this mail thread). Still not sure about queue_work but I can still

[nodejs] Re: [node-dev] Re: Version 0.7.11 (unstable)

2012-06-17 Thread Matt
On Sat, Jun 16, 2012 at 5:22 PM, Isaac Schlueter wrote: > Matt, > > The first install of 3.11 V8 was 3.11.1, which was way too early. (My > mistake to even try pulling it in, but hey, the tests passed, so it > must work, right?) That was in 0.7.9. > > V8 3.11.1 didn't pass its correctness tests

Re: [nodejs] Node Addon: Threads and libuv ref counter (C++)

2012-06-17 Thread Ben Noordhuis
On Mon, Jun 18, 2012 at 2:11 AM, wtfux wrote: > With uv_queue_work Node will automatically stay open until the thread quits. > Do I still need uv_ref or this async_send stuff? Not for thread management but... > What I need but yet have to implement is that the Node's main thread will > stay aliv

Re: [nodejs] cp.fork with stdout

2012-06-17 Thread Ben Noordhuis
On Sat, Jun 16, 2012 at 10:44 PM, Tim Dickinson wrote: > How do i get the stdout from a child process fork? > > Im running node 0.7.11 can i use the new stdio pipe options to get to the > stream of stdout? Not quite. A child process spawned with .fork() inherits stdout and stderr from its parent

[nodejs] Re: Algorithm help

2012-06-17 Thread Marco Rogers
And object with a blank prototype is a little nicer for using as a hash. You don't have to worry about iterating over they keys with for..in and getting the Object.prototype properties. var o = {} o.toString // function toString() { [native code] } 'toString' in o // true o = Object.create(nul

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Bradley Meck
It is not just memory sessions, any db where transactions have not completed for the first request and / or are not guaranteed to be in a consistent state can exhibit this behavior. This can also cause problems when storing data in a temporary location that may be cleared. This becomes even mor

Re: [nodejs] An actor model in node.js

2012-06-17 Thread George Stagas
Paul, take a look at https://github.com/stagas/drama It's a full-featured actor framework heavily inspired by Scala Actors and Akka. You can effortlessly spawn as many actors as you need, in both server side (in-process or forked) and client side (using socket.io or websockets) or your own custom

[nodejs] Re: C10K Websocket Test

2012-06-17 Thread dhruvbird
+1 IIRC someone mentioned that ws is more performant. On Saturday, June 16, 2012 2:14:11 PM UTC-7, Weltschmerz wrote: > > Still hasn't tested my version using *ws* I believe. > > On Saturday, June 16, 2012 3:42:30 PM UTC-5, ajlopez wrote: >> >> FYI, I just received this link from an Erlang email

[nodejs] Re: Algorithm help

2012-06-17 Thread Bruno Jouhier
@marcel, Why Object.create(null) rather than {}? You'll get a null prototype instead of Object.prototype but that's often irrelevant. On the other hand you may pay a price for it. I just re-run the benchmark and Object.create is 40 time slower than {} on V8 (chrome). On firefox they are equival

[nodejs] An actor model in node.js

2012-06-17 Thread Paul Miller
So, as you know, erlang is great because of this one. Are there any great actor model implementations currently that will allow you to spawn tens of thousands of processes without bullshit? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-Li

[nodejs] Re: questions about profiling nodejs

2012-06-17 Thread Александр Гурьянов
I have the same problem, but i run google-chrome on the same server. I profile a script file not a http server. And i dont see profile tab, i only can take snapshots of memory in console and view it in console. And HTTP_HOST (i use 127.0.0.1) does not help me. I run script like that: > node --

Re: [nodejs] Re: C10K Websocket Test

2012-06-17 Thread Arnout Kazemier
Me and Felix did some hacking on this benchmark while we at Munich for the Big Techday 5 conference and found out that ws wasn't actually working because the test suite throws a invalid UTF8 error and whole erlang test suite just dies. And yes, WS is currently the fastest web socket module for N

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Fadrizul H
Yeah, clustering is awesome. But if you start using sockets or the module socket.io. then all hell breaks loose. >.< On Jun 17, 2012 2:39 AM, "Diogo Resende" wrote: > I have a module to abstract this, called rack (node-rack on github). I > have to check the changes (I know they are some) to work

Re: [nodejs] An actor model in node.js

2012-06-17 Thread codepilot Account
VHDL On Sun, Jun 17, 2012 at 12:50 AM, Paul Miller wrote: > So, as you know, erlang is great because of this one. > > Are there any great actor model implementations currently that will allow > you to spawn tens of thousands of processes without bullshit? > > -- > Job Board: http://jobs.nodejs.o

Re: [nodejs] An actor model in node.js

2012-06-17 Thread Angel Java Lopez
Interesting. I have few to have an answer... but I could add only some comments, related to my pet projects, work. I think that in Node.js world, we should separate: - local actor implementation - remote communication The second point could be resolved with RPC or something alike. Candidate: dno

[nodejs] Re: [node-dev] Re: Version 0.7.11 (unstable)

2012-06-17 Thread Robert Malko
get a buttload of warnings when building 0.7.11. mostly with ev.c, eio.c, and the openssl stuff up front. not sure it matters because it builds but I thought I'd let you know. on lion. On Saturday, June 16, 2012 5:22:04 PM UTC-4, Isaac Schlueter wrote: > > Matt, > > The first install of 3.11

[nodejs] exit interval

2012-06-17 Thread Angelo Chen
Hi, got a code like this: setInterval(function() { test_call() }, 1); I'd like to exit this interval if certain condition is met, how? Thanks, -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received t

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Guillermo Rauch
Please check out the 'cluster' branch. I'm adding cluster support to socket.io's new realtime engine (github.com/learnboost/engine.io) -- Guillermo Rauch Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Sunday, June 17, 2012 at 1:08, Fadrizul H wrote: > Yeah, clustering is awesome.

Re: [nodejs] exit interval

2012-06-17 Thread Charlie McConnell
Save the object that setInterval() returns, and then pass it to clearInterval() when you want it to stop. http://nodejs.org/api/timers.html#timers_clearinterval_intervalid On Sun, Jun 17, 2012 at 7:15 AM, Angelo Chen wrote: > Hi, > > got a code like this: > > > setInterval(function() { >test

[nodejs] Re: Howdy nodejs group members, I've got a memory question/problem

2012-06-17 Thread Eugene HP
Hi Mark, Can you make some test code you're working on, so I can join to debug process. Thank you. Eugene On Friday, June 8, 2012 5:13:04 PM UTC+2, Mark Essel wrote: > > I've been bugging TJ on node-canvas (https://github.com/LearnBoost/ > node-canvas/issues/177#issuecomment-6154062

Re: [nodejs] exit interval

2012-06-17 Thread Christian Hammer
Hi, try something like this: var intervalId = setInterval(function() { test_call(); }, 1); if(certain_condition) { clearInterval(intervalId); } Chris Am 17.06.2012 um 16:15 schrieb Angelo Chen: > Hi, > > got a code like this: > > > setInterval(function() { >test_call() > },

Re: [nodejs] exit interval

2012-06-17 Thread Louis Santillan
You can also call clearInterval from within the function you pass to setInterval. -L On Sunday, June 17, 2012, Christian Hammer wrote: > Hi, > > try something like this: > > var intervalId = setInterval(function() { > test_call(); > }, 1); > > if(certain_condition) { > clearInterval(inte

Re: [nodejs] Node Addon: Threads and libuv ref counter (C++)

2012-06-17 Thread Nathan Rajlich
The easiest way to deal with the uv_ref/unref() change is to use the NODE_VERSION_AT_LEAST macro from node_version.h. This is what I did for node-ffi: https://github.com/rbranson/node-ffi/blob/02588f775de89aecde82a43bc537dd09e71d958d/src/callback_info.cc#L135-139 On Sat, Jun 16, 2012 at 10:48 AM,

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Ryan Schmidt
In what way? On Jun 17, 2012, at 03:08, Fadrizul H wrote: > Yeah, clustering is awesome. But if you start using sockets or the module > socket.io. then all hell breaks loose. >.< -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Postin

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Bradley Meck
Multiple connections can be made that keep state in a non-transactional/distributed location. This can lead to things where one worker gets a request, saves state in itself temporarily, and then another worker gets a new request dependent on the state in the original worker. req1 -> A -> save s

Re: [nodejs] cluster API is amazing

2012-06-17 Thread Dan Milon
That's why you should never use MemorySession for express, socket.io. Generally, any connection related data cant go in memory. Bradley Meck wrote: >Multiple connections can be made that keep state in a >non-transactional/distributed location. This can lead to things where one >worker gets a

Re: [nodejs] Re: [node-dev] Re: Version 0.7.11 (unstable)

2012-06-17 Thread Ben Noordhuis
On Sun, Jun 17, 2012 at 1:54 PM, Robert Malko wrote: > get a buttload of warnings when building 0.7.11.  mostly with ev.c, eio.c, > and the openssl stuff up front. > > not sure it matters because it builds but I thought I'd let you know. > > on lion. It's mostly harmless. We compile with a lot mo

Re: [nodejs] Node Addon: Threads and libuv ref counter (C++)

2012-06-17 Thread Ben Noordhuis
On Sat, Jun 16, 2012 at 3:08 AM, wtfux wrote: > Hey guys, > I'm quite a beginner at C++ but I still try to create a node addon in order > to use a c++ library in node. > I got it working partially but I have a few problems and questions: > > 1. The library I'm using will stay during the whole life