Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello, excuse me, I want to transfer my application to neffos. How does neffos send messages to websocket thread in web thread? Just like the socket.io-emitter package of node.js socketio #46

Closed
ezewu opened this issue Jul 7, 2020 · 2 comments

Comments

@ezewu
Copy link

ezewu commented Jul 7, 2020

Hello, excuse me, I want to transfer my application to neffos. How does neffos send messages to websocket thread in web thread? Just like the socket.io-emitter package of node.js socketio

@kataras
Copy link
Owner

kataras commented Jul 11, 2020

Hello @ezewu, are you trying to find this: wiki, example? If not please explain more, give an example of go code (if it's a client javascript-only feature request please take a look at the https://github.com/kataras/neffos.js project instead).

@ezewu
Copy link
Author

ezewu commented Jul 11, 2020

const SocketEmit = require('socket.io-emitter')(Redis.redisClient)

exports.getAllSourcePageList = async (ctx, next) => {
  const data = await Source.find({ organizationId: ctx.organizationId }).sort({ 'meta.updateAt': -1 })
  SocketEmit.to('123456').emit('msg')
  ctx.body = {
    code: 200,
    success: true,
    msg: '查询成功',
    data: data,
  }
}

Thank you for your reply. I am a second service. I want to send a message from port 9000 to port 8000, just like SocketEmit.to('123456').emit('msg')
Hello, my golang technology is not very good. I have read every line of your scale-out example. I did not understand it. The sender, do you want to use neffos.Dial to connect to the websocket server?

@ezewu ezewu closed this as completed Aug 7, 2020
@ezewu ezewu reopened this Aug 7, 2020
@ezewu ezewu closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants