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

Conversation

@Ruby184
Copy link

@Ruby184 Ruby184 commented Jul 20, 2018

Proposed changes

Extract serializing messages for ClusterHop to serializer and add conditional implementation when
process is managed by pm2 so messages can be handled by message bus in PM2 module.

See issue #58 for detailed explanation.

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Further comments

Recieved and sent events need to have type when using PM2. I chose the name adonis:hop. This event type needs to be used when listening and emitting messages on PM2 message bus. I wrote a simple PM2 module, which can be used for broadcasting messages. You can install it as follows:

pm2 install ruby184/pm2-adonis

Also when I was testing if everything is working I found that Channel.clusterBroadcast is calling non exisitng method Channel.broadcast, which was renamed to Channel.broadcastPayload in commit 5a3464c. So I fixed it in this PR.

There is one more bug according to broadcasting to workers. When you use Socket.emitTo method, event is sent only to given IDs on current worker, but then broacasted and sent to ALL sockets for topic on other workers. I will send another PR to fix this issue.

Ľubomír Jesze added 2 commits July 20, 2018 14:09
extract serializing messages for ClusterHop to serializer and add conditional implementation when
process is managed by pm2

fix adonisjs#58
@coveralls
Copy link

coveralls commented Jul 20, 2018

Coverage Status

Coverage decreased (-0.4%) to 93.333% when pulling bbc4af2 on Ruby184:pm2-support into 27143fd on adonisjs:develop.

@padinko
Copy link

padinko commented Nov 6, 2019

it's been over a year.
we are using PM2 on production and need to use websockets. how is this pull request? how can I use pm2 cluster mode?

@goraSi
Copy link

goraSi commented Dec 24, 2019

Any updates on this? Would really like to see PM2 cluster support.

@pdias94
Copy link

pdias94 commented Jan 11, 2021

2021 and no updates?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants