Postman - a JavaScript message bus
github.com
Postman - a JavaScript message bus
1–8 of 8 posts
Re: Postman - a JavaScript message bus
#2Re: Postman - a JavaScript message bus
#3Re: Postman - a JavaScript message bus
#4Congratulations. You managed to make a wrapper for arrays in god knows how many commits.
Re: Postman - a JavaScript message bus
#5No, it's a CoffeeScript message bus.
Re: Postman - a JavaScript message bus
#6Re: Postman - a JavaScript message bus
#7It looks inefficient (uses arrays instead of linked lists/queues, so every cleanup requires full array rebuild), lacks any sort of message ordering guarantees (or notifications of lack thereof), lacks queue length limits (only time-based expiry and custom cleanup functions seeing only the value of message are provided) and so on.
Moreover, I don't get the following:
dropByDate = (date, msgs) ->
msgs.reduce (x) ->
x.created
I believe msgs is an array (cache[name].history), but IIRC Array.reduce does not work like this, it's Array.filter that does.Re: Postman - a JavaScript message bus
#8Could someone please explain me what's the point of this? I can't imagine any serious use case. It looks inefficient (uses arrays instead of linked lists/queues, so every cleanup requires full array rebuild), lacks any sort of message ordering guarantees (or notifications of lack thereof), lacks queue length limits (only time-based expiry and custom cleanup functions seeing only the value of message are provided) and…
As for linked lists vs arrays I'm not convinced that a linked list would be a better performer than an array for iterative access (which is a rather crucial part of the library).
The reduce thing is a bug (I've chucked it on the issue register) as well as a feature request for only keeping a finite message limit.