~gioverse/chat

3166b2ed3c580fb4c746a3d1c2e07e460e6eb612 — Jack Mordaunt 3 months ago b724dfa
async: [fix] respect max loaded worker count

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
1 files changed, 1 insertions(+), 1 deletions(-)

M async/loader.go
M async/loader.go => async/loader.go +1 -1
@@ 223,7 223,7 @@ func (l *Loader) Schedule(tag Tag, load LoadFunc) Resource {
			// 128 is a magic number of maximum workers we will allow.
			// This would translate to "max number of network requests", if all
			// work were to be network-bound.
			l.Scheduler = &FixedWorkerPool{Workers: runtime.NumCPU()}
			l.Scheduler = &FixedWorkerPool{Workers: l.MaxLoaded}
		}
		// TODO(jfm): expose context in the public api so that loads can be
		// cancelled by it.