-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
Milestone
Description
We can move the call to FlushAPMData()
to the goroutine tasked with processing APM data chunks (as a follow-up to case <- funcDone
), and then move this goroutine to apm_server.go
.
Quoting @felixbarny in PR #148:
The benefit is that the APM Server client is then only executed from a single thread and we don't have to add locks or other mechanisms to ensure visibility.
We might even want to move the background goroutine to apm_server.go. In main.go, we would then just be calling
backgroundDataSendWg := extension.startBackgroundSending(config.SendStrategy)
.
main.go
would just enqueue events to the agentData channel and apm_server.go is responsible for consuming from that channel. This feels like a better separation of producer/consumer concerns.