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

Declare SearchRequest state variables in constructor. #20578

Merged
merged 1 commit into from
Jul 9, 2018

Conversation

cjcenizal
Copy link
Contributor

No description provided.

@cjcenizal cjcenizal added chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.0.0 v6.4.0 labels Jul 9, 2018
@cjcenizal cjcenizal requested a review from stacey-gammon July 9, 2018 18:03
Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes lgtm (did not pull down and test).

return false;
}

if (this.stopped) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't suppose in your travels of courier you understand the logic behind this? I like how you split this out, but it logically seems strange to me. No worries if you don't since this PR is unrelated, but if you do know, I think this could go for a comment. Why can't this be started if it's stopped? you can't "restart"? And below, I guess this._isFetchRequested means that it's already been started? The top one is obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny you should ask! I made these comments as I started trying to make sense of all of this but then I gave up. A lot of this logic exists to support courier's indirection-based architecture and from everything I've seen, I think the best solution will be to replace it with a more explicit architecture (e.g. #20364).

Why can't this be started if it's stopped? you can't "restart"?

I don't know the answers to these ones.

And below, I guess this._isFetchRequested means that it's already been started?

I actually read a comment you left in this file which explained this for me:

    /**
     *  Called by the fetchSoon module when this request has been sent to
     *  be fetched. At that point the request is somewhere between `ready-to-start`
     *  and `started`. The fetch module then waits a short period of time to
     *  allow requests to build up in the request queue, and then immediately
     *  fetches all requests that return true from `isFetchRequestedAndPending()`
     *
     *  @return {undefined}
     */
    _setFetchRequested() {
      this._isFetchRequested = true;
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I guess it means it's going to start, but hasn't started yet?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal cjcenizal merged commit 433f8a9 into elastic:master Jul 9, 2018
@cjcenizal cjcenizal deleted the clarify-search-request-states branch July 9, 2018 20:49
cjcenizal added a commit to cjcenizal/kibana that referenced this pull request Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.4.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants