Example #1
0
 process.nextTick( function () {
     //See ~snake.js:100 both this and the above tick
     //will be in the same group of process._tickCallback
     //So they would both log.  I'm going to leave it for now.
     self.anotherSnake = draino.snake('newSnake', true);
     snake.too();
     console.log('Multiple snakes can watch at the same time.');
     
 });
Example #2
0
 topic : function () {
     var self = this;
     console.log('noAppend makes things before the snake not append.');
     var snake = self.snake = draino.snake('myName', true);
     console.log('Statements after a new snake are appended.');
     console.error('console.error is not appended');
     process.binding('stdio').writeError('process.binding(\'stdio\').writeError is not appended either, but it could be if you ask me.\n')
     setTimeout(function () {
         snake.too();
         console.log('Statements in another event loop after snake.too() are appended');
         (function () {
             console.log('Even if they are in a different function');
         }());
         log('Even if they no not have scope access to snake');
         process.nextTick( function () {
             console.log('Statements without a snake.too(), even proccess.nextTick will not be appended.');
             process.nextTick( function () {
                 console.log('Statements before snake.too() are appended.');
                 snake.too();
                 process.nextTick( function () {
                     console.log('Statements before snake.too(true) are not appended.');
                     snake.too(true);
                 });
                 process.nextTick( function () {
                     //See ~snake.js:100 both this and the above tick
                     //will be in the same group of process._tickCallback
                     //So they would both log.  I'm going to leave it for now.
                     self.anotherSnake = draino.snake('newSnake', true);
                     snake.too();
                     console.log('Multiple snakes can watch at the same time.');
                     
                 });
             });
         });
     },5);
     
     setTimeout(function () {
         self.callback();
     },10)
 },
Example #3
0
 topic : function () {
     this.snake = draino.snake('myName');
     console.log('Log Stmt');
     this.callback();
 },