fn: move memory/token code into resource (#512)

*) bugfix: fix nil ptr access in docker registry RoundTrip
*) move async and ram token related code into resource.go
This commit is contained in:
Tolga Ceylan
2017-11-17 15:25:53 -08:00
committed by Travis Reeder
parent 1acb1e99b4
commit 17d4271ffb
4 changed files with 117 additions and 91 deletions

View File

@@ -15,7 +15,7 @@ func (a *agent) asyncDequeue() {
select {
case <-a.shutdown:
return
case <-a.asyncRAM():
case <-a.resources.WaitAsyncResource():
// TODO we _could_ return a token here to reserve the ram so that there's
// not a race between here and Submit but we're single threaded
// dequeueing and retries handled gracefully inside of Submit if we run