Skip to content

Adding optional parameter "sleep" with min and max limits#31

Merged
aaronpowell merged 5 commits intoaaronpowell:masterfrom
balarajagopal:master
Jun 12, 2017
Merged

Adding optional parameter "sleep" with min and max limits#31
aaronpowell merged 5 commits intoaaronpowell:masterfrom
balarajagopal:master

Conversation

@balarajagopal
Copy link
Copy Markdown
Contributor

Adding optional parameter "sleep" with min and max limits of 0 and 300000 (5 mins).

E.g. usage:
http://server-name/400?sleep=5000
This will return HTTP 400 after 5 seconds

http://server-name/400
This will return HTTP 400 immediatly

Adding an optional parameter "sleep" to delay response
Adding optional parameter "sleep" with min and max limits of 0 and 300000 (5 mins).

E.g. usage:
http://server-name/400?sleep=5000
This will return HTTP 400 after 5 seconds 

http://server-name/400
This will return HTTP 400 immediatly
Adding optional parameter "sleep" with min and max limits of 0 and 300000 (5 mins).

E.g. usage:
http://server-name/400?sleep=5000
This will return HTTP 400 after 5 seconds 

http://server-name/400
This will return HTTP 400 immediatly
Adding helper method DoSleep to avoid some code repetition.
}

public ActionResult StatusCode(int statusCode)
public ActionResult StatusCode(int statusCode, int? sleep = 0)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Should this be int? sleep = SLEEP_MIN?

}

public ActionResult Cors(int statusCode)
public ActionResult Cors(int statusCode, int? sleep=0)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could we keep consistent spacing here, so have a space before and after the =

/// Limits the sleep parameter
/// </summary>
/// <param name="sleep"></param>
/// <returns></returns>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Don't need to bother with the XML doc comments

Using const for constants instead of static readonly so they can be used to assign optional sleep paramater
@aaronpowell aaronpowell merged commit bd0b2bb into aaronpowell:master Jun 12, 2017
Copy link
Copy Markdown
Contributor Author

@balarajagopal balarajagopal left a comment

Choose a reason for hiding this comment

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

I have made the suggested changes :)

@aaronpowell
Copy link
Copy Markdown
Owner

Merged and should be live now 😃

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