Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next() always wrapped in nextTick #4

Open
cappslock opened this issue Jan 25, 2013 · 1 comment
Open

next() always wrapped in nextTick #4

cappslock opened this issue Jan 25, 2013 · 1 comment

Comments

@cappslock
Copy link

It appears that the invocation of each step is wrapped in nextTick(). This makes some things very difficult. For example, opening a ReadableStream via http.request in a pipeline and passing the stream to a further step or 'end' event before a 'data' event is triggered.

If there isn't a good reason to wrap everything in nextTick it should probably removed. Alternately a pipeline could be indicated as synchronous somehow and nextTick could be conditionally used.

@panthershark
Copy link
Owner

Can you show me a code sample with an issue?

Whether nextTick is there or not, attaching stream event emitters asynchronously is likely problematic because you increase chance of race conditions. If you are running a synchronous pipeline, then you may want to just use a single function.

nextTick() is there to increase pipeline concurrency and keep smaller call stack in high load scenarios. If an asynchronously calling distinct closures cause a problem, then it might be best to refactor the pipeline design.

Maybe I missed something. Code sample please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants