Closed SteelAlloy closed 2 years ago
It's not something I would incorporate into the crate itself—too many configuration options, too much policy—but it should be possible to make a wrapper struct which would forward operations to an inner LDAP handle while also arranging some kind of signalling from the connection task (i.e., not simply using the drive!
macro) to recognize connection shutdown and attempt reconnection.
I think it would indeed not fit in the crate, but a piece of code to do this based on the library would be very useful. I'll try to do this myself, but I'm a novice with Rust. If you have some tracks, or a skeleton of code I'll take it !
What seems to me the most complex is the signal system
For signalling, you can see how it's done between an Ldap
handle and its connection in src/conn.rs
and src/ldap.rs
. TLDR: it's a bunch of oneshot and mpsc channels, plus Tokio's select!
.
Since this is a usage issue, or at best an enhancement proposal which would be a WONTFIX for the reasons stated above, I'll close the issue. It can be reopened if necessary.
In the javascript world I was using ldapjs which has a
reconnect
option.Would it be possible to reproduce a similar feature, that is to say to have a long-lived connection that reconnects automatically when the connection is closed ?
I have very long connection time with my server, so it would reduce loading time a lot.
Thanks !