code: func (s *MatcherSession) Multiplex(batch int, wait time.Duration, mux chan chan *Retrieval) {
  	for {
  		// Allocate a new bloom bit index to retrieve data for, stopping when done
  		bit, ok := s.AllocateRetrieval()
  		if !ok {
  			return
  		}
  		// Bit allocated, throttle a bit if we're below our batch limit
  		if s.PendingSections(bit) < batch {
  			select {
  			case <-s.quit:
  				// Session terminating, we can't meaningfully service, abort
  				s.AllocateSections(bit, 0)
  				s.DeliverSections(bit, []uint64{}, [][]byte{})
  				return
  
  			case <-time.After(wait):
  				// Throttling up, fetch whatever's available
  			}
  		}
  		// Allocate as much as we can handle and request servicing
  		sections := s.AllocateSections(bit, batch)
  		request := make(chan *Retrieval)
  
  		select {
  		case <-s.quit:
  			// Session terminating, we can't meaningfully service, abort
  			s.DeliverSections(bit, sections, make([][]byte, len(sections)))
  			return
  
  		case mux <- request:
  			// Retrieval accepted, something must arrive before we're aborting
  			request <- &Retrieval{Bit: bit, Sections: sections, Context: s.ctx}
  
  			result := <-request
  			if result.Error != nil {
  				s.err.Store(result.Error)
  				s.Close()
  			}
  			s.DeliverSections(result.Bit, result.Sections, result.Bitsets)
  		}
  	}
  }
docs: // Multiplex polls the matcher session for retrieval tasks and multiplexes it into
  // the requested retrieval queue to be serviced together with other sessions.
  //
  // This method will block for the lifetime of the session. Even after termination
  // of the session, any request in-flight need to be responded to! Empty responses
  // are fine though in that case.