Just like 3.5 years ago, I was able to synchronously wait for a WorkerPromise to resolve. This will let me run asynchronous code inside my application, but still allow my stick middleware to handle the response. But it is really ugly.
function handleWorkerPromise ( request ) {
var wp = new WorkerPromise ( module.resolve ( './nls_worker' ), { request: request }, true );
wp.wait ( 5000 )
var result
wp.then ( function ( payload ) {
result = json ( payload )
},
function ( error ) {
result = error
}
)
return result
}
Furthermore, if my application code needs to yield for a promise (promise.wait() seems to be the only way to do this in Ringo), I will have to repeat this exercise for each of those types of interactions, and that doesn't seem very friendly.