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

core: Use consistent asynchronous API #300

Merged
merged 2 commits into from
Jul 24, 2019

Conversation

albrow
Copy link
Contributor

@albrow albrow commented Jul 23, 2019

Related to #96.

Since I was already changing some related code, I went ahead and fixed #299 in this PR too.

@@ -39,7 +41,9 @@ func main() {
if err != nil {
log.WithField("error", err.Error()).Fatal("could not initialize app")
}
if err := app.Start(); err != nil {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
Copy link
Contributor Author

@albrow albrow Jul 23, 2019

Choose a reason for hiding this comment

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

It's a little awkward that we have both defer cancel() and defer app.Close() but that will go away once all the packages that core uses are also using the same consistent asynchronous API.

core/core.go Outdated Show resolved Hide resolved
@albrow albrow force-pushed the feature/core-consistent-async-api branch from eaf06b9 to b6078a7 Compare July 24, 2019 20:35
Co-Authored-By: Fabio B <me@fabioberger.com>
@albrow albrow merged commit c6529c7 into development Jul 24, 2019
@albrow albrow deleted the feature/core-consistent-async-api branch July 24, 2019 21:18
@albrow albrow changed the title Use consistent asynchronous API for core package core: Use consistent asynchronous API Jul 24, 2019
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.

Fail fast after calling app.Close
2 participants