promisfy bind close
parent
16da37a101
commit
b40ed4169f
|
@ -1,5 +1,6 @@
|
||||||
import WebSocket from 'ws'
|
import WebSocket from 'ws'
|
||||||
import btc from 'better-try-catch'
|
import btc from 'better-try-catch'
|
||||||
|
import { promisify } from 'util'
|
||||||
import _ON_DEATH from 'death' //this is intentionally ugly
|
import _ON_DEATH from 'death' //this is intentionally ugly
|
||||||
import clone from 'clone'
|
import clone from 'clone'
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ class Socket extends WebSocket.Server {
|
||||||
//self bindings
|
//self bindings
|
||||||
this._listen = this._listen.bind(this)
|
this._listen = this._listen.bind(this)
|
||||||
this.create = this.create.bind(this)
|
this.create = this.create.bind(this)
|
||||||
|
this.close = promisify(this.close).bind(this)
|
||||||
log = logger({
|
log = logger({
|
||||||
file: 'src/socket.js',
|
file: 'src/socket.js',
|
||||||
class: 'Socket',
|
class: 'Socket',
|
||||||
|
|
Loading…
Reference in New Issue