I'm trying to make a web crawler to fetch products from certain sites to reduce my memory usage (I've got a memory leak somewhere i haven't found). So I'm trying to send arguments to a callback asynchronously in order to terminate the current context.
This is where I'm at:
var big = html.get(url);
callback(big);
big = null; // this isn't going to get erased until after big is done is it?
This is what I've tried:
var big = html.get(url);
process.nextTick(function() {callback(big)}); // this seems wrong to me.
big = null;