Skip to content

bindEmitter does not work? #40

Open
@iliakan

Description

@iliakan

The code below uses bindEmitter to bind the response object to the current context.

So onfinish must keep the context, right?

// bind
process.namespaces.app.bindEmitter(this.res);

// plan onfinish in the future
this.res.once('finish', onfinish);

var mark = Math.random();
console.log(mark, process.namespaces.app.get('requestId'));

// onfinish will trigger later, but in current context?
function onfinish(event) {
    console.log(mark, process.namespaces.app.get('requestId'));
}

For same mark, the requestId must be same?
I'm asking, because it's not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions