Skip to content

Move the APM Data processing goroutine to apm_server.go #151

@jlvoiseux

Description

@jlvoiseux

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions