You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the examples it's not entirely clear to me how I can access data that I pass to the bindEmitter() function. In the code below I use the createServer from the http module. Now my question is, how can I save the request and response objects to later access them from my foo function?
varcreateNamespace=require('continuation-local-storage').createNamespace;varsession=createNamespace('some namespace');varhttp=require('http');functionfoo(){// How do I access res/req from here?}http.createServer(function(req,res){session.bindEmitter(req);session.bindEmitter(res);// Call foo without passing in req and res.foo();}).listen(8000);
The text was updated successfully, but these errors were encountered:
From the examples it's not entirely clear to me how I can access data that I pass to the
bindEmitter()
function. In the code below I use thecreateServer
from thehttp
module. Now my question is, how can I save the request and response objects to later access them from myfoo
function?The text was updated successfully, but these errors were encountered: