Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Startup sequence should throw if the Startup method isn't void-returning #27

Closed
GrabYourPitchforks opened this issue Apr 18, 2014 · 4 comments
Assignees
Milestone

Comments

@GrabYourPitchforks
Copy link
Contributor

We saw a scenario where somebody inadvertently wrote a Task-returning Startup method, and the runtime misbehaved since the method hadn't run to completion before the application was booted.

We should check the signature of the Startup method to make sure it's void-returning before we invoke it.

@Eilon
Copy link
Member

Eilon commented Apr 20, 2014

Out of curiosity, what should you do if from your Startup method you want to call something that's async? E.g. I want to verify a connection to my database and do some... stuff.

@GrabYourPitchforks
Copy link
Contributor Author

MyAsyncMethod().Result or MyAsyncMethod().Wait().

@Eilon
Copy link
Member

Eilon commented Apr 20, 2014

And that's OK? That is, Levi won't flag it in a code review? 😉

@GrabYourPitchforks GrabYourPitchforks self-assigned this Apr 21, 2014
@Tratcher Tratcher mentioned this issue Apr 22, 2014
@GrabYourPitchforks
Copy link
Contributor Author

Resolved as 4077c03.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants