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

Misc #231

Merged
merged 31 commits into from
Mar 17, 2015
Merged

Misc #231

merged 31 commits into from
Mar 17, 2015

Conversation

pietern
Copy link
Contributor

@pietern pietern commented Mar 10, 2015

This PR is a bag of stuff I came across while moving functionality out of the root package into independent subpackages and moving all code to use a context.Context to make it easy to control client side timeouts on arbitrary sequences of requests. See: http://godoc.org/golang.org/x/net/context

Including:

  • Move the event manager to a package (cc @daniellockard)
  • Move the session manager to a package (cc @cgtexmex @hickeng)
  • We were using url.URL as value instead of pointer value (unnatural if you look at the stdlib)
  • Embed *soap.Client in root client
  • Add keep alive soap.RoundTripper to session package (cc @hickeng)
  • Move functionality to wait for a task to complete to task package
  • Move managed object wrapper structs to object package
  • Move property collector wrapper and functions to property package
  • Wrapper functions in object package use context.Context
  • Client in root package uses context.Context

@pietern pietern force-pushed the move branch 3 times, most recently from 5422094 to fb0033d Compare March 16, 2015 20:02
pietern added 2 commits March 16, 2015 15:29
This function uses CreateFilter to be selective in the updates it
receives. Filters can only be added to property collectors, not removed.
This means that a property collector is no longer useful after being
used by Wait. This in turn means that it is most convenient to have Wait
create and destroy a property collector for its own use.
@dougm
Copy link
Member

dougm commented Mar 17, 2015

Awesome @pietern , looks great! btw, feel free to remove '_gen' from the filenames, we can revisit that if we get a decent wrapper generator working.

@pietern
Copy link
Contributor Author

pietern commented Mar 17, 2015

@mkuzmin As a heads up, once this PR is merged it will break downstream code.

Wiring context.Context into the entire library was prompted by both your WaitForIP timeout problems and some code I had written that needed timeout management. Now that everything is wired up, every in flight chain of requests can be cancelled outside-in at any time. Through context.Context it is trivial to add timeouts to sequences of requests.

pietern added a commit that referenced this pull request Mar 17, 2015
@pietern pietern merged commit 699036c into vmware:master Mar 17, 2015
@pietern pietern deleted the move branch March 17, 2015 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants