code: func (w *worker) updateMiddlewareAndJobTypes(middleware []*middlewareHandler, jobTypes map[string]*jobType) {
  	w.middleware = middleware
  	sampler := prioritySampler{}
  	for _, jt := range jobTypes {
  		sampler.add(jt.Priority,
  			redisKeyJobs(w.namespace, jt.Name),
  			redisKeyJobsInProgress(w.namespace, w.poolID, jt.Name),
  			redisKeyJobsPaused(w.namespace, jt.Name),
  			redisKeyJobsLock(w.namespace, jt.Name),
  			redisKeyJobsLockInfo(w.namespace, jt.Name),
  			redisKeyJobsConcurrency(w.namespace, jt.Name))
  	}
  	w.sampler = sampler
  	w.jobTypes = jobTypes
  	w.redisFetchScript = redis.NewScript(len(jobTypes)*fetchKeysPerJobType, redisLuaFetchJob)
  }
docs: // note: can't be called while the thing is started