runtime for easily building fast, scalable network applications. • Node.js uses an event-driven, non- blocking I/O model that makes it lightweight and efficient, perfect for data- intensive real-time applications that run across distributed devices. mandag den 29. oktober 12
it in an array) • Everything is so much harder (what’s going on here, who moved my cheese?) • No database roundtrips (fast) • No persistence (ouch) mandag den 29. oktober 12
that the user sesion is valid and matches the uid provided. 3 */ 4 function validate_session(uid, sid, callback) { 5 // Validate the user's session. 6 drupal.user.session_load(sid, function (err, session) { 7 // Load the user object from Drupal. 8 drupal.user.load(uid, function (err, user) { 9 drupal.user.role_permissions(user.roles, function (perms) { 10 user.permissions = perms; 11 callback(null, user); 12 }); 13 }); 14 }); 15 } Database-level integration mandag den 29. oktober 12