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

Already on GitHub? Sign in to your account

Mapping socket.io events to controller actions #175

Closed
srad opened this Issue Aug 21, 2012 · 4 comments

Comments

Projects
None yet
2 participants

srad commented Aug 21, 2012

I just saw your socket.io integration and was wondering
if you have any idea or plan how to integrate socket.io into controllers?

Or is there somewhere documentation about that?

Contributor

Techwraith commented Aug 21, 2012

The usage currently looks like this:

  1. add socketIo: true to your config file
  2. install socket.io: npm install socket.io
  3. create a config/after_start.js file in your app and add your listener code there.
  4. use geddy.io in your controllers/models too
Contributor

Techwraith commented Aug 21, 2012

I've also got a pull request out there that should give us a better integration when it's finished - mde#164

srad commented Aug 22, 2012

Alright I'm looking forward to the new pull.

Currently it's not practical to use socket.io. Because everything must be defined within the after_start.js file
because the geddy.io ref is assigned "after" the controller code is executed and has access to geddy.io,
so you can't access geddy.io within the controller.

Contributor

Techwraith commented Aug 22, 2012

Ah, that's a bug then, I'll see if I can get a fix in for that today.

On Aug 22, 2012, at 2:17 AM, Saman notifications@github.com wrote:

Alright I'm looking forward to the new pull.

Currently it's not practical to use socket.io. Because everything must be defined within the after_start.js file
because the geddy.io ref is assigned "after" the controller code is executed and has access to geddy.io,
so you can't access geddy.io within the controller.


Reply to this email directly or view it on GitHub.

@Techwraith Techwraith closed this Nov 3, 2012

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