Need definitive and working way to use socketio

66 views
Skip to first unread message

Darryl Porter

unread,
Dec 24, 2013, 10:17:39 PM12/24/13
to locomo...@googlegroups.com
I been stumbling with locomotive for about a week now. My main attraction is that it is the "fullest" full stack frameworks for nodejs. However, my attraction to node is the ability to build real-time apps with socketio.

Over the last few days I have read everything out there on locomotive and socketio integration and have found nothing that works in a way that makes since.

Could someone please give a full example of how to use these two together.

Jared Hanson

unread,
Dec 25, 2013, 1:01:41 PM12/25/13
to locomo...@googlegroups.com
Could you provide some details as to what you've read/tried, as well as how you would expect it to work?

I'd love to see further integration in this area.  However, I find that other frameworks trying to unify RESTful and real-time approaches tend to not do either very well.  In my own apps, where I need to support both models, I tend to have minimal Locomotive controllers and real-time handlers sharing a set of common libraries.  This tends to work well.

There are some common patterns to abstract from that work, but I haven't quite teased them out in a way I'm satisfied with.  Until then, though, I think its best to stay focused on doing one thing, and doing it well.  But, I'd love to see further discussion on this topic, and how integration could be done effectively.

Jared



--
You received this message because you are subscribed to the Google Groups "Locomotive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to locomotivejs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Jared Hanson <http://jaredhanson.net/>

Darryl Porter

unread,
Dec 26, 2013, 9:43:40 AM12/26/13
to locomo...@googlegroups.com
Thanks for your response.

I read this thread:

And this one:

Ideally, I'd like to create a custom boot function for creating the web server with  socketio support. In that, I'd like to attach the socketio instance to the application instance with something like this:

var socketio = require('socket.io');
locomotive.boot(function() {

  this.io = socketio.listen(this.server);//Or whatever the server instance is.
});
And from a controller be able to grab the "this.io".
Is something like this possible. My example is simplistic, but hopefully you understand what I'd like to attempt.

THanks

Ka Yuk LEE

unread,
Feb 5, 2014, 12:12:15 AM2/5/14
to locomo...@googlegroups.com
I stumbled upon a repo but have not tried it:

https://github.com/kayakyakr/locomotive-http-socketio-server

Darryl Porter

unread,
Feb 5, 2014, 8:17:19 AM2/5/14
to locomo...@googlegroups.com

Thanks, I'll take a look

You received this message because you are subscribed to a topic in the Google Groups "Locomotive" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/locomotivejs/HLzEV-_HTo8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to locomotivejs...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages