[nodejs] Re: updating my UI when my server got a message via socket.io

2012-04-22 Thread josh
Thank you Guillermo.
So I'll end up with 3 (probably more in the future) apps that talk to
each other using socket.io.
is there a good way to manage them and not getting lost with the
configuration and provisioning?

I noticed a few project by substack that might be relevant, but I
don't understand them ):
https://github.com/substack/fleet
https://github.com/substack/airport
https://github.com/substack/zygote
https://github.com/substack/seaport

Another question - I looked at dnode (https://github.com/substack/
dnode).
you can make remote calls from the browser to your server using it.
What is the main difference between dnode and socket.io?



On Apr 22, 12:02 pm, Guillermo Rauch  wrote:
> Separating responsibilities between different apps is almost always a good
> choice. Communicating those apps through messages (eg: ømq) leads to good
> architecture.
>
> --
> Guillermo Rauch
> LearnBoost CTOhttp://devthought.com

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: updating my UI when my server got a message via socket.io

2012-04-22 Thread Guillermo Rauch
Separating responsibilities between different apps is almost always a good
choice. Communicating those apps through messages (eg: ømq) leads to good
architecture.

-- 
Guillermo Rauch
LearnBoost CTO
http://devthought.com

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: updating my UI when my server got a message via socket.io

2012-04-22 Thread josh
I figured it out.
I use socket.io also between the Admin browser and the Admin server,
so when the user browser's sends a message to the admin's server, the 
server emit it  to the admin's browser.
similar flow goes when the admin want to send a message to a specific user 
(I keep the socket ids).

I am still considering splitting it into 3 apps, so the socket.io server 
will stand on it's own. 
any pro/cons about this?


On Saturday, April 21, 2012 7:54:32 PM UTC-7, josh wrote:
>
> I am building 2 separate express sites: 
> clients website - visitors can talk to me (the admin of the site) via 
> chat (1 on 1 only. they can't see each other). 
> admin website - for me, the admin, to see all current conversations 
> and the ability to reply to whatever user I want. 
>
> I am using socket.io to emit messages from the clients website to the 
> admin website. 
>
> Is there a way to update the Admin UI whenever the admin site receives 
> a message? 
> Is there a way from the UI to emit a message back to the client's 
> browser? 
> Is there a problem with the design of my sites? maybe i should have 3 
> separate apps and not 2 (so the socket.io server will stand on it's 
> own). 
>
> Any other alternatives/suggestions would be great. 
> Thanks! 
>
> this code is part of the Admin server: 
>
>   basket = {}; // holds a hash of sockets 
>
>   socket.on('msg', function (data) { 
> socket.get('nickname', function (err, name) { 
>   console.log('Chat message by ', name, ' saying', data.text); 
>   var to = basket[name]; 
>// i don't want to send this from here. i want the admin to see 
> all messages from different users 
>// and he should be able to reply whenever he wants to 
>   //to.emit('msg', { text: "what's up " + name }); 
> }); 
>   }); 
> }); 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en