Hook.io alternatives to auto-discovery?

80 views
Skip to first unread message

Daniel Thurman

unread,
Aug 8, 2012, 11:35:09 AM8/8/12
to hoo...@googlegroups.com

Other than auto-discovery what options exist for defining how a set of Hook.io enabled processes communicate? 

I'm looking for a feature that allows me to define how/where hooks will communicate. I've spent a few hours reading source code and documentation and I haven't found anything yet so hopefully someone in the group knows and can point me to a section of the source code, documentation or better yet and example.

I am hoping I can do something like this:

var hook = new Hook({
  name : 'my-hook',
  port : 1234, 
  socket : '../socket/hook.sock'
});


Here's a little background context to explain why I'm looking for this... I have a group of processes that work together, a master and a set of workers. So long as there is only one instance of the group running everything works fine using auto-discovery (new Hook({/*no options*/}); But now that I need multiple developers working on the code on a dev server everything is fubar using auto-discovery. All instances end up cross talking to each other. The simplest option would seem to be the use a socket file for communication and I'd define that as a relative path so all instances would be isolated. If defining a port for communication is more easily implemented then I'd need to be able to test if it's already in use by another instance and walk up until I find a free port. 


Thanks in advance,

-Dan

Joshua Holbrook

unread,
Aug 8, 2012, 4:51:47 PM8/8/12
to hoo...@googlegroups.com
You can use hook.connect and hook.listen to set port/host explicitly
instead of using the auto-discovery.

--Josh
--
Joshua Holbrook
Head of Support
Nodejitsu Inc.
jo...@nodejitsu.com
Reply all
Reply to author
Forward
0 new messages