Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.

Commit

Permalink
refactor(examples): remove examples dir
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Mar 5, 2018
1 parent a8b7d15 commit 2391a1f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 143 deletions.
69 changes: 0 additions & 69 deletions example/decoders.js

This file was deleted.

37 changes: 0 additions & 37 deletions example/index.html

This file was deleted.

19 changes: 0 additions & 19 deletions example/index.js

This file was deleted.

16 changes: 0 additions & 16 deletions example/socketio.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@adonisjs/sink": "^1.0.16",
"japa": "^1.0.6",
"japa-cli": "^1.0.1",
"msgpack-lite": "^0.1.26",
"nyc": "^11.4.1",
"standard": "^11.0.0"
},
Expand All @@ -32,7 +33,6 @@
"debug": "^3.1.0",
"emittery": "^0.3.0",
"macroable": "^1.0.0",
"msgpack-lite": "^0.1.26",
"ws": "^4.1.0"
},
"nyc": {
Expand Down
8 changes: 7 additions & 1 deletion src/Ws/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ChannelManager = require('../Channel/Manager')
*/
class Ws {
constructor (Config) {
this._options = Config.merge('app.ws', {
this._options = Config.merge('socket', {
path: '/adonis-ws',
serverInterval: 30000,
serverAttempts: 3,
Expand Down Expand Up @@ -153,6 +153,7 @@ class Ws {
*/
handle (ws, req) {
const connection = new Connection(ws, req, this._encoder)

connection.on('close', (__connection__) => {
this._connections.delete(__connection__)
})
Expand All @@ -179,6 +180,11 @@ class Ws {
*/
listen (server) {
this._wsServer = new WebSocket.Server(Object.assign({}, this._serverOptions, { server }))

/**
* Make cluster hop to listen for new messages on
* process.
*/
ClusterHop.init()

/**
Expand Down

0 comments on commit 2391a1f

Please sign in to comment.