DataDog / glommio

Glommio is a thread-per-core crate that makes writing highly parallel asynchronous applications in a thread-per-core architecture easier for rustaceans.
Other
2.93k stars 161 forks source link

Make sendable files capable of being duped #622

Closed vlovich closed 7 months ago

vlovich commented 8 months ago

What does this PR do?

Adds the dup method to OwnedDmaFile.

Motivation

I have a benchmark where I want to test how long it takes to process a file and for accuracy of the benchmark I want to avoid the open path as it's more expensive than just duping the fd.

Related issues

Additional Notes

Checklist

[] I have added unit tests to the code I am submitting [] My unit tests cover both failure and success scenarios [] If applicable, I have discussed my architecture

Didn't bother writing tests for this as it seemed like a trivial change.