Questions tagged [evented-io]
17 questions
506
votes
10 answers
What is Node.js?
I don't fully get what Node.js is all about. Maybe it's because I am mainly a web based business application developer. What is it and what is the use of it?
My understanding so far is that:
The programming model is event driven, especially the way…

Jeff
- 13,079
- 23
- 71
- 102
17
votes
6 answers
What are some architectural reasons to use node.js aside from scalability?
The most common theme I read about why to use node.js is for high scalability due to it's evented, non-blocking I/O model. I'm trying to understand other non-scalability uses cases (and aside from being used as a general server-side javascript…

Howiecamp
- 2,981
- 6
- 38
- 59
15
votes
2 answers
How exactly does Play framework 2.0 controllers / Async work?
I've recently moved to Play framework 2.0 and there are some questions concerning me regarding how controllers actually work in play.
In play docs there are mentioned:
Because of the way Play 2.0 works, the action code must be as fast as
possible…

arturaz
- 767
- 6
- 18
12
votes
3 answers
How to check the number of open connections in node.js?
I have a machine running node.js (v0.1.32) with a tcp server (tcp.createServer) and a http server (http.createServer). The http server is hit by long polling requests (lasting 50 sec each) from a comet based application on port 80. And there are tcp…

Sharief Shaik
- 1,064
- 5
- 12
- 26
9
votes
2 answers
How does the Node.js event loop work?
After playing with Node.js and reading about async i/o & evented programming a lot I'm left with some question marks.
Consider the following (pseudo) code:
var http = require('http');
function onRequest(request, response)
{
// some non-blocking…

Justin Case
- 133
- 1
- 5
9
votes
2 answers
Thin server underperforming / How do evented web servers work?
I had a rails 3 app on Nginx/Passenger that I just moved to Nginx/Thin (1.3.1). However, my app is now clearly slower than it was on Passenger. A lot of requests time out too.
Thin is an evented webserver. From what I have read about evented web…

Coffee Bite
- 4,956
- 5
- 33
- 38
8
votes
1 answer
How does the UV_RUN_NOWAIT mode work in libuv?
When running an event loop in libuv using the uv_run function, there's a "mode" parameter that is used with the following values:
UV_RUN_DEFAULT
UV_RUN_ONCE
UV_RUN_NOWAIT
The first two are obvious. UV_RUN_DEFAULT runs the event loop until there are…

Alexis King
- 43,109
- 15
- 131
- 205
6
votes
3 answers
are there any simple/example event-driven webservers in C?
There are many example thread based web servers online, but I haven't really seen anything that gives a good example of an event-loop based one (without being very complex, e.g. lighttp and nginx).
Are there any? If not, what should I read/look at…

Aaron Yodaiken
- 19,163
- 32
- 103
- 184
5
votes
1 answer
Node.js provide an efficiency in doing nothing?
I heard a speaker described Node.js as a webserver that "efficiently does nothing". I thought it was a joke but others looked to nod agreement. Can someone explain my misunderstanding of this phrase?

Eli Schneider
- 4,903
- 3
- 28
- 50
4
votes
1 answer
Lightweight streaming HTTP proxy for Rack (Ruby CPU-light HTTP client library)
So I am experimenting with a situation where I want to stream huge files from a third-party URL, through my server, to the requesting client.
So far I have tried implementing this with Curb or Net::HTTP by adhering to the standard Rack practice of…

Julik
- 7,676
- 2
- 34
- 48
3
votes
2 answers
Lightweight Threads in Operating Systems
It is said that one of the main benefits of Node (and presumable twisted et al) over more conventional threaded servers, is the very high concurrency enabled by the event loop model. The biggest reason for this is that each thread has a high memory…

acrophobia
- 924
- 7
- 22
3
votes
2 answers
Where does node.js sit in the client <--> web server flow?
With respect to how node.js fits in with clients and web servers, is my description below correct?
(A) are clients
(B) is node.js running on some web server
(C) are "services" hosting business logic, database access routines, e.g. "GetCustomer()". …

Howiecamp
- 2,981
- 6
- 38
- 59
1
vote
1 answer
Ember.js Evented Controller triggering an event
I am trying to trigger an event from an Ember.js controller so the listening views can update themselves. Here is the Coffeescript.
window.CMS.EdmController = Ember.ObjectController.extend Ember.Evented,
actions:
save_edm: ->
postData =…

Anand S
- 87
- 1
- 10
0
votes
1 answer
Does this Socket.IO code create a blocked connection?
The general rule in writing Node.js code is that all code should be non-blocking and communicate via events. I would like to know if this code written using the Socket.IO library for Node.js create a blocked connection, or does it follow the general…

n3m6
- 1
- 2
0
votes
1 answer
Thread.pass when using IO.select
I am writing to a socket in a threaded server (running on MRI at the moment). Doing it with the following code:
begin
num_bytes_written = socket.write_nonblock(chunk)
if num_bytes_written < chunk.bytesize
chunk =…

Julik
- 7,676
- 2
- 34
- 48