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
{{ message }}
Repository navigation
If tick is called in futureTickQueue we got exception #60
On our project we call futureTick() in case in stream handler we need to wait for new data to populate. It has internal call to tick() that eventually clears current futureTick queue. In FutureTickQueue in tick() we simply call dequeue() exact amount of times equal to queue length at the tick() beginning. The problem is that we don't check if queue is already empty.
@nick4fake it's a horrible hack that I would not recomend 😞 , heck I strongly discourage of doing it when there are alternatives. It 'works' but only in most circumstances. That one in particular was made to provide a fully working PSR-7 stream. @clue made a much better way of doing that here. Another place I use it is here, but there I'm doing it because Guzzle uses some funky queue that I have to keep running in order for the adapter to work 😞 .
@WyriHaximus thanks for giving some insight! What do you suggest we should do here? Is this something worth fixing or should we look into avoiding this altogether (is this even reasonable?)?
Activity
Fixes reactphp#60: check for queue length in FutureTickQueue::tick()
clue commentedon Nov 16, 2016
I'm not sure I follow what you're doing, can you provide a gist to reproduce this?
In case you're calling
tick()will the loop is running, this is probably where the problem comes from. This should not be done, ever.nick4fake commentedon Nov 18, 2016
@clue Please check this library:
https://github.com/WyriHaximus/reactphp-psr7-stream-converter/blob/master/src/ReactToPSR7Stream.php
Here tick() is called if on read there is no data. If I understand correctly, this is for loop not to block.
I use futureTick to queue read/write pipeline, eg:
Is this a correct way to implement PSR7->PSR7 pipeline?
nick4fake commentedon Nov 18, 2016
Another example:
https://github.com/WyriHaximus/ReactGuzzle/blob/master/src/HttpClientAdapter.php
What if we make a call inside a loop?
clue commentedon Nov 18, 2016
Let's ping @WyriHaximus and let's see what he has to add 👍
WyriHaximus commentedon Nov 18, 2016
@nick4fake it's a horrible hack that I would not recomend 😞 , heck I strongly discourage of doing it when there are alternatives. It 'works' but only in most circumstances. That one in particular was made to provide a fully working
PSR-7stream. @clue made a much better way of doing that here. Another place I use it is here, but there I'm doing it because Guzzle uses some funky queue that I have to keep running in order for the adapter to work 😞 .clue commentedon Nov 19, 2016
@WyriHaximus thanks for giving some insight! What do you suggest we should do here? Is this something worth fixing or should we look into avoiding this altogether (is this even reasonable?)?
clue commentedon Feb 8, 2017
I believe this has been superseded now that #72 is in and the
tick()method has been removed 👍I'm closing this for now, please feel free to come back with more details if this problem persists and we can reopen this 👍