Closed iartem closed 3 years ago
Merging #98 (ace22ee) into master (8ca7910) will decrease coverage by
0.57%
. The diff coverage is0.00%
.
Impacted Files | Coverage Δ | |
---|---|---|
src/lib.rs | 84.61% <ø> (ø) |
|
src/read/factory.rs | 0.00% <0.00%> (ø) |
Ah, no, the Factory
isn't a way to construct a new map, it's a way to get a version of a ReadHandle
that you can share across thread boundaries. The idea is that you construct a map somewhere, create a ReadHandleFactory
from the ReadHandle
, and then stick that ReadHandleFactory
in, say, an Arc
. Then, in any thread that needs a ReadHandle
, you call ReadHandle::handle
.
Alright, and how do I create a ReadHandleFactory
from the ReadHandle
? Correct me if I'm wrong, but everything is pub(crate)
.
You're completely right, seems like a method is indeed missing and I was overly hasty :sweat_smile:. Specifically:
impl ReadHandle {
pub fn factory(&self) -> ReadHandleFactory {
ReadHandleFactor {
inner: Arc::clone(&self.inner),
epochs: Arc::clone(&self.epochs),
}
}
}
Want to submit a PR that adds that method?
Done 😄
It seems
ReadHandleFactory
couldn't be used previously as there were no respective crate functions exported. Not sure if that's intended though.This change is