Currently there are two ways to get a list of nodes:
- fetch and return a single page (default size: 200), then make a subsequent call to go-acd to get the next page
- fetch all nodes (loop hidden behind the method call) and return all nodes at once
Both are suboptimal: 1. puts the burden of loop coordination onto go-acd client, 2. blocks the go-acd client until all nodes have been retrieved and stores them all in memory until final processing.
The best of both approaches is to support page-wise processing of nodes. The go-acd client would pass a function which gets called for every fetched page.
A further improvement is to enable concurrent operations through goroutines and channels: fetch the nodes in a goroutine, send unmarshalled nodes into a channel, process them in parallel to fetching the next page.
Currently there are two ways to get a list of nodes:
Both are suboptimal: 1. puts the burden of loop coordination onto go-acd client, 2. blocks the go-acd client until all nodes have been retrieved and stores them all in memory until final processing.
The best of both approaches is to support page-wise processing of nodes. The go-acd client would pass a function which gets called for every fetched page.
A further improvement is to enable concurrent operations through goroutines and channels: fetch the nodes in a goroutine, send unmarshalled nodes into a channel, process them in parallel to fetching the next page.