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

Uniter API now has WatchActions #141

Merged
merged 12 commits into from Jul 9, 2014

Conversation

binary132
Copy link
Contributor

This commit adds state/api and state/apiserver endpoints for
WatchActions.

// Initial event.
wc.AssertChange()

// Update config a couple of times, check a single event.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's only once AFAICS.

@mjs
Copy link

mjs commented Jun 24, 2014

This is looking good - just a few concerns about test coverage of error cases.


// Consume the initial event. API calls to Watch 'transmit'
// the initial event in the Watch response.
if _, ok := <-watch.Changes(); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

The discarded result ought to be sent back in the response...

@mjs
Copy link

mjs commented Jun 25, 2014

This is looking good. All issues I've raised have been addressed. It might be best to wait for a final pass by @fwereade before this lands.

Changes: changes,
}, nil
}
return nothing, watcher.MustErr(watch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, that MustErr is a problem. Is it the same everywhere? Even if a single watcher is somehow screwed up, it shouldn't be able to take out the whole API server...

Wouldn't surprise me if we had the damn things everywhere, so don't feel obliged if it's consistent -- but please do add a bug pointing out that MustErr is not safe and should basically never be used except in client code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@binary132
Copy link
Contributor Author

I've updated this to reflect @johnweldon's changes to the ActionsWatcher behavior (Actions pending at the time of the Watcher's creation now arrive with the first event.)

@@ -437,6 +437,26 @@ func (u *Unit) WatchAddresses() (watcher.NotifyWatcher, error) {
return w, nil
}

func (u *Unit) WatchActions() (watcher.StringsWatcher, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

public method needs a comment

@bz2
Copy link
Contributor

bz2 commented Jul 9, 2014

LGTM.

@binary132
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jul 9, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Jul 9, 2014
Uniter API now has WatchActions

This commit adds state/api and state/apiserver endpoints for
WatchActions.
@jujubot jujubot merged commit ade4674 into juju:master Jul 9, 2014
@binary132 binary132 deleted the actions-uniter-api-watcher branch July 9, 2014 14:25
laszlokajtar pushed a commit to laszlokajtar/juju that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants