r/programming • • Apr 26 '16

Node.js v6.0 released

https://nodejs.org/en/blog/announcements/v6-release/
132 Upvotes

79 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Apr 27 '16

[removed] — view removed comment

1

u/RazerWolf Apr 27 '16 edited Apr 27 '16

Node isn't capable of doing something similar. You can somewhat simulate it with a timer, but since it is single-threaded you [cores] instance of Node, each with its own log separate queue and timer.

Wait, what? You have a set of queues and a set of timers, which are checked every threshold interval (like every second or so). You store your log entries in queues and write them with async batch writes when they pass a size/time threshold.

This is even a more efficient solution because I'm not forced to use multiple threads to do this. What is this solution missing for you?

0

u/[deleted] Apr 27 '16

[removed] — view removed comment

0

u/RazerWolf Apr 27 '16

You used the concept of threads when I explicitly mentioned not to do this. You know timers can exist without threads right? DispatcherTimer does this in WPF (https://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchertimer(v=vs.110).aspx)

You need 24 queues, and 24 timers, and one node instance which will have a "dispatchTimers" called some point in its event loop.

→ More replies (0)