influxdb-client-go icon indicating copy to clipboard operation
influxdb-client-go copied to clipboard

Synchronous API with batching support

Open sjwang90 opened this issue 3 years ago • 0 comments

Proposal: synchronous API with batching support

Current behavior: async API is wrong-headed for Go

Desired behavior:

WriteAPIBlocking.WriteRecord could add stuff to a batch, and when the batch needs sending, it could send it. Adding a Flush method that may return an error from a previous write is sufficient, there doesn’t need to be any goroutines / channels at all. See e.g. https://pkg.go.dev/bufio#Writer.Flush

Alternatives considered: Describe other solutions or features you considered.

Use case: Why is this important (helps with prioritizing requests)?

@lesam

sjwang90 avatar Jun 23 '22 18:06 sjwang90