Move the code to native

This commit is contained in:
Cheng Zhao 2016-08-01 20:11:17 +09:00
parent d23d9dcf01
commit ffed3e9c0c
2 changed files with 11 additions and 6 deletions

View file

@ -14,15 +14,9 @@ Object.defineProperties(exports, {
}
})
const sessions = []
// Wraps native Session class.
_setWrapSession(function (session) {
// Session is an EventEmitter.
Object.setPrototypeOf(session, EventEmitter.prototype)
app.emit('session-created', session)
// The Sessions should never be garbage collected, since the common pattern is
// to use partition strings, instead of using the Session object directly.
sessions.push(session)
})