NodeJS and synchrone call to mysql

I m actually developping a little application, in which I use a service to access my data in MYSQL.

Actually, it works great using callback fonction :

service.request('SELECT * FROM table', function(data){
    mydata = data
})

I need to use it without callback, without blocking the node eventloop like this :

mydata = service.request('SELECT * FROM table')

Is it possible to do this ? How could I do ?

EDIT : How to do this with Fiber and Future libraries ? :D

Thanks for advance

you can use wait.for, a wrapper over Fibers:

https://github.com/luciotato/waitfor

var wait=require('wait.for');

function process(){
   var data = wait.forMethod(service,"request",'SELECT * FROM table');
   console.log(data);
}

wait.launchFiber(process);

If you need the response from the server before you can continue code execution, then there is nothing you can do but wait for it to get back. This code should be written in the callback.

If you want to get the response from the server, but don't necessarily need the response to continue code execution, then you should write this code after making the call but outside of the callback.

service.request('SELECT * FROM table', function(data) {
    var mydata = data;

    //do the stuff that requires mydata
});

//keep doing stuff that does not require mydata.

The thing is, you can't both get your data back from the database and not wait for it to come back! No amount of technology can solve that problem :)