Skip to content

bindEmitter after context.exit should work? #43

Open
@iliakan

Description

@iliakan

If the code uses bindEmitter, and the emitter triggers after context.exit(), should the emitter work?

For example, the code:

app.use(function*(next) {
    var context = ns.createContext();
    ns.enter(context);

    ns.bindEmitter(this.req);
    ns.bindEmitter(this.res);

    try {
      ns.set('context', this);
      yield* next;
    } finally {
      ns.exit(context);
    }
  });

If this.res emits an event after ns.exit, this event will normally be handled in the context?

I'm asking that, because it must really help to track dead ends in the app. Must know whether this should work or 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