Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.lock*
3 changes: 3 additions & 0 deletions helloworld/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var helloWorld = require('./build/Release/helloworld');
var world = new helloWorld.HelloWorld();
console.log(world.hello());
4 changes: 1 addition & 3 deletions helloworld_eio/helloworld_eio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,13 @@ class HelloWorldEio: ObjectWrap
}


static int EIO_Hello(eio_req *req)
static void EIO_Hello(eio_req *req)
{
hello_baton_t *baton = static_cast<hello_baton_t *>(req->data);

sleep(baton->sleep_for);

baton->hw->m_count += baton->increment_by;

return 0;
}

static int EIO_AfterHello(eio_req *req)
Expand Down
8 changes: 8 additions & 0 deletions helloworld_eio/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var helloeio = require('./build/Release/helloworld_eio');
var hi = new helloeio.HelloWorldEio();
hi.hello(function(data){
console.log(data);
});
//Outputting something here to show that the callback is non-blocking and this
//output will be displayed before the Hello World message.
console.log('Outputted after the async call to hello world.');