Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created January 20, 2020 16:03
Show Gist options
  • Save fwojciec/17ae108ae04bce1af6d7697dcdbf675e to your computer and use it in GitHub Desktop.
Save fwojciec/17ae108ae04bce1af6d7697dcdbf675e to your computer and use it in GitHub Desktop.
gqlserver2: dataloaders8
// AgentLoaderConfig captures the config to create a new AgentLoader
type AgentLoaderConfig struct {
// Fetch is a method that provides the data for the loader
Fetch func(keys []int64) ([]*pg.Agent, []error)
// Wait is how long wait before sending a batch
Wait time.Duration
// MaxBatch will limit the maximum number of keys to send in one batch, 0 = not limit
MaxBatch int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment