-
Notifications
You must be signed in to change notification settings - Fork 55
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
What the sense in ReactPHP and it is Promises if QueryBus works synchronously? #189
Comments
see https://github.com/prooph/service-bus/blob/master/tests/QueryBusTest.php
Sascha-Oliver Prolic
2018-06-30 2:43 GMT+08:00 BonBonSlick <[email protected]>:
… I have tested 2 queries
`$this->queryBus->dispatch(new GetUserList( ))->then(
function($result){
dump($result); // some result
}
);
$this->queryBus->dispatch( new GetUserList( ))->then(
function($result) {
dump($result); // empty should be
}
)
;`
for first one handler i put sleep for 5 seconds, and here reslts are
//first - should be last, coz results + sleep
Paginator {#3327 ▼
...
}
//second, should be first, because no sleep + empty results
[]
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#189>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAYEvGoo4xUQEXwu-H2ym9upfSAmb0elks5uBnVUgaJpZM4U9da9>
.
|
@prolic thank you for your response, i still do not get it. |
You can wrap the query bus with your own implementation, so that you wrap the promise and return the real value. This should be very easy to write in a few minutes. I think someone posted the implementation for this already somewhere, but I can't remember. About the initial question, I think you should use |
reactphp/promise#43 for a similar question. E.g. you have to make the async code yourself. For synchronous code the promise is still synchronous too. |
@prolic Method 'done' not found in \React\Promise\PromiseInterface less... (Ctrl+F1 Alt+T) |
|
Thank you for clarification. |
@BonBonSlick @codeliner wanna provide some docs? otherwise it's just another issue sitting here for years :) |
It is ok, we changed to symfony messenger. Use only your store everything else written from scratch |
I have tested 2 queries
for first one handler i put sleep for 5 seconds, and here results are
Maybe i missed something, please tell me please.
The text was updated successfully, but these errors were encountered: