Thanks for the explanation.
Dnode seems to be nice for RPC but I think it does not solve all problems
stated above by default (or I just did not discover it but I didn't found a
good documentation).
Especially on client side I discovered managing listeners can be quite a
pain for example with lots of listeners while logged in or viewing a
special page. Restricting the client to only listen on particular messages
(or emit) proved to be very handy for me having a clear socket api.
On Tuesday, September 24, 2013 1:56:41 PM UTC+2, spion wrote:
>
>
>
> On Tuesday, September 24, 2013 1:02:31 PM UTC+2, André Eife wrote:
>>
>> For example in the JSON file I can define (and mix) the type of each
>> message seen from the client side: only allow listening on message, only
>> allow emitting the message or a "get" type which is like RPC (emit and
>> listen once for answer).
>>
>> And the other problems like listener management and missing wildcards
>> seem to remain in dnode if I'm not mistaken.
>>
>>
> dnode allows you to implement/use any callback-based RPC. For example:
>
> function createRPC() {
> var ee = new WildcardEventEmitter();
> var self = {};
>
> self.on = ee.on.bind(ee);
> self.emit = ee.emit.bind(ee);
> return self;
> }
>
> stream.pipe(dnode(createRPC())).pipe(stream);
>
> client:
> ... connect and pipe dnode through shoe, then:
>
> d.on('remote', function(remote) {
> // this will call wildcardListener.on('wildcard.*, fn);
> remote.on('wildcard.*', function listener(data) { ... });
> });
>
--
--
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
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.