add ContextWithTimeout and ContextWithDeadline #282

Merged
merged 1 commit into from Jun 15, 2017

Conversation

Projects
None yet
4 participants
Owner

rogpeppe commented Jun 15, 2017

The stdlib context package doesn't make it easy to use
deadlines and timeouts with mock clocks. These
new functions mimic context.WithTimeout and context.WithDeadline
but using mockable clocks instead.

This does come at some cost - an extra goroutine will
be used when none was needed previously.

LGTM

Owner

rogpeppe commented Jun 15, 2017

$$merge$$

Contributor

jujubot commented Jun 15, 2017

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

Contributor

jujubot commented Jun 15, 2017

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

Contributor

jujubot commented Jun 15, 2017

add ContextWithTimeout and ContextWithDeadline
The stdlib context package doesn't make it easy to use
deadlines and timeouts with mock clocks. These
new functions mimic context.WithTimeout and context.WithDeadline
but using mockable clocks instead.

This does come at some cost - an extra goroutine will
be used when none was needed previously.
Owner

rogpeppe commented Jun 15, 2017

$$merge$$

Contributor

jujubot commented Jun 15, 2017

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

Contributor

jujubot commented Jun 15, 2017

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

@jujubot jujubot merged commit 60474fc into juju:master Jun 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment