#### Description
[gofumpt](https://golangci-lint.run/usage/linters/#gofumpt) is a
stricter format than gofmt, while being backwards compatible.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This PR adds a public function `GetNextItem` to queue (both persistent
queue and bounded memory queue)
Why this change?
Instead of blocking until consumption of the item is done, we would like
to separate the API for reading and committing consumption.
Before:
`Consume(consumeFunc)`
After:
`idx, item = Read()`
`OnProcessingFinished(idx)`
<!-- Issue number if applicable -->
#### Link to tracking issue
https://github.com/open-telemetry/opentelemetry-collector/issues/8122https://github.com/open-telemetry/opentelemetry-collector/issues/10368
<!--Describe what testing was performed and which tests were added.-->
#### Testing
<!--Describe the documentation added.-->
#### Documentation
<!--Please delete paragraphs that you did not use before submitting.-->
#### Description
Why this change?
Each request from the queue contains multiple items, and those items
could be merge-split into multiple batches when they are sent out (see
https://github.com/open-telemetry/opentelemetry-collector/issues/8122
for more about exporter batcher). We would like to book-keep those
cases, and only call `onProcessingFinished` when all such batches has
gone out. In this PR, `onProcessingFinished` is changed from a callback
to a method function because it is easier to book keep index instead of
functions.
#### Link to tracking issue
https://github.com/open-telemetry/opentelemetry-collector/issues/8122https://github.com/open-telemetry/opentelemetry-collector/issues/10368
#### Testing
`exporter/internal/queue/persistent_queue_test.go`
#### Documentation
This is an internal change invisible to the users.
---------
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>