Or better yet: just solve it yourself.

I built exactly that, jsmx. Available on npm, very simple source at 
https://github.com/deitch/jsmx



On Sunday, June 10, 2012 11:35:12 AM UTC+3, deitch wrote:
>
> And, yes, I *know* I can use event emitter for this (or EventEmitter2, 
> which is cleaner), but the point is to have it.
>
> On Sunday, June 10, 2012 11:21:43 AM UTC+3, deitch wrote:
>>
>> Is anything out there?
>>
>> Sample use case: app has several logging levels, with a default. The 
>> default is overridden by an env var LOG_LEVEL, read on startup. Easy. 
>>
>> Now I want to change the LOG_LEVEL to debug (or some higher level) for, 
>> say, 30 minutes, and then change it back. I do *not* want to restart my app 
>> - which would be necessary if I just changed the env var - because I may 
>> lose some state that is crucial to my debugging effort.
>>
>> Is there anything?
>>
>> The way I would see it working, you have a "message bus" type object, 
>> which anyone can subscribe to, but it publishes from the outside using http.
>>
>> var mx = require('mx');
>> mx.sub('messagePattern',callbackFn);
>>
>> Option A: use the already existing http listener, but have a special URL 
>> path http://myserver/specialpath?param=val&param=val&;....
>> Option B: set up a "message bus" type object, which anything can listen 
>> to for messages, it then listens on a different port to isolate the traffic 
>> from production traffic.
>>
>> mx.listen(somePort);
>>
>> From the outside, you then talk HTTP to that given port (should have a 
>> well-known default) to send a management message to the app:
>>
>> curl http://localhost:somePort/messagePattern?param=val&param=val....
>>
>> (or you can PUT or POST).
>>
>> Would need some form of authentication, but that is easy using http auth.
>>
>> Thoughts here?
>>
>

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to