You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may just not be used to node/javascript idioms, but I think there is a race condition since there is no way to make sure that the event listeners are set up before events start getting triggered.
will not write out any data because the vcf object emits all of its 'data' events before the 'data' listener is setup. But if the delay parameter (1000) is changed to '0', then the 'data' and 'end' listeners are setup in time.
I don't know if this is a problem in the real-world (if the .on('data'... directly follows the .read call, then maybe there is no way for the race to occur?)
Apologies if I just mis-understand the idiom.
The text was updated successfully, but these errors were encountered:
I may just not be used to node/javascript idioms, but I think there is a race condition since there is no way to make sure that the event listeners are set up before events start getting triggered.
For instance, something like the following:
will not write out any data because the vcf object emits all of its 'data' events before the 'data' listener is setup. But if the delay parameter (1000) is changed to '0', then the 'data' and 'end' listeners are setup in time.
I don't know if this is a problem in the real-world (if the
.on('data'...
directly follows the .read call, then maybe there is no way for the race to occur?)Apologies if I just mis-understand the idiom.
The text was updated successfully, but these errors were encountered: