Closed halzy closed 3 months ago
If one tries to copy the Fds
struct up into their app to implement it the error is:
error[E0053]: method `start_service` has an incompatible type for trait
The struct copied is:
pub struct Fds {
map: HashMap<String, std::os::fd::RawFd>,
}
Thanks @halzy I've patched this in #149
Thanks @halzy I've patched this in #149
I see. I'm not certain that the other public functions in that module are useful in the public interface as they are part of the machinery for transfering the sockets between pingoras. 🤷 We'll see what the folks at Cloudflare want to do.
Do you have any sample code that actually uses the contents of Option<Arc<tokio::sync::Mutex<pingora::server::transfer_fd::Fds>>>
. That would help me provide a better answer.
Nothing that I can share at the moment. I posted the patch that solved my issue in #146.
Describe the bug
When trying to implement
pingora::services::Service
theFds
struct is not public because thetransfer_fd
module is private:error[E0603]: module `transfer_fd` is private
Pingora info
Pingora version: 0.1.0 Rust version: cargo 1.76.0 (c84b36747 2024-01-18) Operating system version: OSX 14.2.1 (23C71)
Steps to reproduce
When trying to implement the
pingora::services::Service
trait it is not possible due to the 2nd argument ofstart_service
-fds
type not beingpub
:Expected results
The
Fds
orListenFds
type is public.In
pingora-core/src/server/mod.rs
ListenFds
ispub(crate)
:52:pub(crate) type ListenFds = Arc<Mutex<Fds>>;
in
pingora-core/src/server/mod.rs
thetransfer_fd
mod ispub(crate)
:19:pub(crate) mod transfer_fd;
Observed results
What actually happened?
error[E0603]: module `transfer_fd` is private