QuickStreams icon indicating copy to clipboard operation
QuickStreams copied to clipboard

Async counter example doesn't work (event observer's not called)

Open Choochmeque opened this issue 7 years ago • 1 comments

Hello. Trying to use this product but it doesn't work as expected, maybe I've missed something. Qt 5.9, VS 2015 32bit Here is code:

function spawnCounter() {
	return QuickStreams.create(function(mainStream) {
		var iteration = 0
		QuickStreams.timeout(1000, function(stream) {
			iteration++
			mainStream.event('update', iteration)
			stream.close()
		})
		.repeat()
	})
}
/* .............................................................. */
var counterStream = spawnCounter()

counterStream.event('update', function(stream, iteration) {
	console.log('current iteration:', iteration) /* <----- THIS NEVER CALLS */
})

Choochmeque avatar Apr 23 '18 11:04 Choochmeque

QuickStreams is not a product, it's a proof of concept implementation of asynchronous programming in streams (as the README says).

Work on this particular repository was suspended for quite a while now. I'd need to investigate the problem, though unfortunatelly I've currently no time for experiments.

This experiment was suspended due to the lack of feedback so there's no evidence people really need the idea of async programing in streams in the first place when there are other well established paradigms like reactive extensions and similar. I may return to this concept and repo when there's some time to play around again and especially if the actual concept proves relevant.

Still, thank you very much for taking your time, if there are any questions please feel free to ask, I'm open for discussions and usually don't bite.

romshark avatar Apr 23 '18 16:04 romshark