Merge lp://staging/~stolowski/unity-scopes-api/sss-no-wait-for-all into lp://staging/unity-scopes-api/devel

Proposed by Paweł Stołowski
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 476
Merged at revision: 474
Proposed branch: lp://staging/~stolowski/unity-scopes-api/sss-no-wait-for-all
Merge into: lp://staging/unity-scopes-api/devel
Diff against target: 1524 lines (+550/-427)
11 files modified
include/unity/scopes/internal/smartscopes/HttpClientInterface.h (+7/-5)
include/unity/scopes/internal/smartscopes/HttpClientQt.h (+4/-4)
include/unity/scopes/internal/smartscopes/HttpClientQtThread.h (+3/-1)
include/unity/scopes/internal/smartscopes/SmartScopesClient.h (+26/-9)
src/scopes/internal/smartscopes/HttpClientQt.cpp (+10/-13)
src/scopes/internal/smartscopes/HttpClientQtThread.cpp (+36/-6)
src/scopes/internal/smartscopes/SmartScope.cpp (+121/-96)
src/scopes/internal/smartscopes/SmartScopesClient.cpp (+171/-177)
test/gtest/scopes/internal/smartscopes/HttpClient/HttpClient_test.cpp (+25/-23)
test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp (+101/-52)
test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+46/-41)
To merge this branch: bzr merge lp://staging/~stolowski/unity-scopes-api/sss-no-wait-for-all
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Marcus Tomlinson (community) Approve
Michi Henning (community) Needs Information
Review via email: mp+232586@code.staging.launchpad.net

Commit message

Push smart scopes online results immediately as they become available.

Description of the change

Push smart scopes online results immediately as they become available.
This required quite a bit of refactoring. Still WIP.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michi Henning (michihenning) wrote :

Minor comment:

std::future<void> HttpClientQt::HttpSession::get_future()
{
    return promise_->get_future();
}

Not totally sure here, but it looks a little strange. Why is promise_ a shared_ptr instead of a promise? Couldn't it just be a plain promise?

Marcus, you are most familiar with this code, could you cast your eye over it too please?

review: Needs Information
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

> Minor comment:
>
> std::future<void> HttpClientQt::HttpSession::get_future()
> {
> return promise_->get_future();
> }
>
> Not totally sure here, but it looks a little strange. Why is promise_ a
> shared_ptr instead of a promise? Couldn't it just be a plain promise?
>
> Marcus, you are most familiar with this code, could you cast your eye over it
> too please?

Hmmm, no idea why this was a shared_ptr. Must have been some legacy reason that I removed since. Pawel, could you change the promise_ member to a std::promise<std::string> for me please? Sorry about that :/

475. By Paweł Stołowski

Don't use shared ptr for promise member.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

> > Minor comment:
> >
> > std::future<void> HttpClientQt::HttpSession::get_future()
> > {
> > return promise_->get_future();
> > }
> >
> > Not totally sure here, but it looks a little strange. Why is promise_ a
> > shared_ptr instead of a promise? Couldn't it just be a plain promise?
> >
> > Marcus, you are most familiar with this code, could you cast your eye over
> it
> > too please?
>
> Hmmm, no idea why this was a shared_ptr. Must have been some legacy reason
> that I removed since. Pawel, could you change the promise_ member to a
> std::promise<std::string> for me please? Sorry about that :/

Ok, done

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This is awesome! I was almost certain there was going to be some valgrind complaints with the new Qt stuff, but there wasn't :) Yay!

Just some small observations:

677 + //response_str = response->get();

You can remove this line.

864 +void SmartScopesClient::wait_for_search(uint search_id)

In this method there is now an unused "std::string response_str;", you can remove that now.

988 +void SmartScopesClient::wait_for_preview(uint preview_id)

Same thing here (unused "std::string response_str;")

1102 + //EXPECT_NO_THROW(response_str = response->get());

You can remove this line.

review: Needs Fixing
476. By Paweł Stołowski

Remove unused local variables and commented-out lines.

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Excellent job!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: