background preloader

Socket.IO: the cross-browser WebSocket for realtime apps.

https://socket.io/

Related:  JavaScript

The Tapir's Tale: A Not Very Short Introduction To Node.js Node.js is a set of asynchronous libraries, built on top of the Google V8 Javascript Engine. Node is used for server side development in Javascript. Do you feel the rush of the 90's coming through your head. It is not the revival of LiveWire, Node is a different beast.

6 Free E-Books and Tutorials for Learning and Mastering Node.js OK, we won't bore you by telling you what Node.js is again or why it's so dang hot. You want to learn Node.js? There's no completely finished Node.js book out there that we're aware of. npm registry npm registry all tags author updated depended on 1 statestream 4push 1 push-node 4sq Felix's Node.js Convincing the boss guide « Home / All Guides Now that you're all hyped up about using node.js, it's time to convince your boss. Well, maybe. I have had the pleasure of consulting for different businesses on whether node.js is the right technology, and sometimes the answer is simply no. So this guide is my opinionated collection of advice for those of you that want to explore whether node.js makes sense for their business, and if so, how to convince the management.

NoSQL Databases and Node.js In recent years, non-relational DBMSs have reemerged with proponents’ claiming advantages in scalability and simplicity. Many of these DBMSs now exist targeted towards a variety of usage scenarios. They are popularly referred to as NoSQL databases. JavaScript Garden Although JavaScript deals fine with the syntax of two matching curly braces for blocks, it does not support block scope; hence, all that is left in the language is function scope. function test() { // a scope for(var i = 0; i < 10; i++) { // not a scope // count } console.log(i); // 10} There are also no distinct namespaces in JavaScript, which means that everything gets defined in one globally shared namespace. Each time a variable is referenced, JavaScript will traverse upwards through all the scopes until it finds it.

Node.JS + WebSocket = near real offline/online check « Simple API The problem is well know : the online/offline state is not reliable on many browser, this create a difficult situation for developers who wants to create an offline solution : if you don’t know when the client is online or offline, this became difficult to manage (for example) a local backup before having a new connection. Note : if you already use socket.io, you can combine with existing one, because here I only use basic event from socket.io (in this case, you only need the client part). With this simple trick on client side and server side, I was able to manage (at +/- 5sec) a good online/offline test : Server : Here I use console from previous page here but if you don’t want, just replace "cs." by "console." Just pass a socket.io to this module like this :

Understanding the node.js event loop So the largest waste with current programming technologies comes from waiting for I/O to complete. There are several ways in which one can deal with the performance impact (from Sam Rushing): The second basis thesis is that thread-per-connection is memory-expensive: [e.g. that graph everyone showns about Apache sucking up memory compared to Nginx] Apache is multithreaded: it spawns a thread per request (or process, it depends on the conf). You can see how that overhead eats up memory as the number of concurrent connections increases and more threads are needed to serve multiple simulataneous clients. Nginx and Node.js are not multithreaded, because threads and processes carry a heavy memory cost.

Related:  ModulesWEB TECHNOLOGY