nameserv::auto(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

🌸 nameserv::auto β€” the manual, but make it make sense πŸ’…

okay bestie, so this is page nameserv::auto(n) from the tcllib collection, and honestly? it's giving "your fave client, but with abandonment issues (affectionate)". let's get into it 🫢


✨ NAME ✨

nameserv::auto β€” Name service facility, Client Extension. yes she's an extension. yes she's that girl. πŸ’–


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require nameserv::auto ?0.4?

package require nameserv

✨ DESCRIPTION ✨

okay so first things first, queen: go read the doc Name service facility, introduction before you read this one. fr fr, it's the prerequisite. πŸ™ˆ

so this package? it hands you the exact same API as the package nameserv, like, the regular name service client. no notes on the API itself. BUT β€” and this is the whole personality β€” it goes the extra mile to make sure your longer-lived data survives when the connection to the name server ghosts you. we're talking:

  • bound names
  • continuous searches
  • unfullfilled async searches

she keeps those alive as much as is humanly (and technically) possible. πŸ‘‘

what that actually means: the bound names and the continuous + unfullfilled async searches get remembered client-side, and then automatically re-entered into the server once the connection comes back after being lost. iconic behavior, honestly.

but bestie, there's one important limitation on restoring bound names and I need you to hear me: it is possible that one of this client's names got bound by a different client while the connection was gone. names like that are fully lost. the absolute best this package can do β€” and the thing it will do β€” is tell the user about it. that's it. that's the ceiling. 😭

✨ API ✨

the user-visible API is mainly identical to the API of nameserv, so it's not getting described here. go read the docs for nameserv. she's not repeating herself, she's efficient. πŸ’…

the differences? they're down below in the OPTIONS and EVENTS sections. keep scrolling.


✨ OPTIONS ✨

this package supports all the options of package nameserv, plus exactly one more. and the bonus option lets you set the time interval between attempts to restore a lost connection. so thoughtful of her. πŸŽ€

  • -delay milliseconds β€” the value of this option is an integer value > 0, and it specifies the interval to wait between attempts to restore a lost connection, measured in milliseconds. the default value is 1000, i.e. one second. so if you do nothing, she's checking back every second. loyal. ⭐

✨ EVENTS ✨

this package generates all of the events of package nameserv, plus two more. both of these extra events are generated for the tag nameserv. πŸ¦‹

  • lost-name β€” this event fires when a bound name is truly lost, i.e. it could not be restored after the temporary loss of the connection to the name server. it's the signal that a different client took ownership of the name while this client was out of contact. the detail information of the event is a Tcl dictionary containing two keys, name, and data. their values hold all the information about the lost name. rip to that name honestly πŸ’€
  • re-connection β€” this event fires when the connection to the server is restored. and here's the cute part: the remembered data has already been restored by the time the event is posted. the event has no detail information. she just shows up to say "we're so back". 🌈

✨ DESIGN ✨

so how is she built? the package is implemented on top of the regular nameservice client, i.e. package nameserv. she detects the loss of the connection by listening for lost-connection events, on the tag nameserv. πŸ‘€

her reaction to those events: she starts a periodic timer and tries to reconnect to the server whenever this timer triggers. on success she cancels the timer, generates a re-connection event, and then proceeds to re-enter the remembered bound names and continuous searches. slay. ✨

and if the connection drops again β€” whether that's during or after re-entering the remembered information β€” she simply restarts the timer and the subsequent reconnection attempts. no drama, just persistence. periodt. πŸ’œ


✨ BUGS, IDEAS, FEEDBACK ✨

ngl, this document and the package it describes will undoubtedly contain bugs and other problems. it's giving "we're all just doing our best". πŸ™ˆ

please report such bugs in the category nameserv of the Tcllib Trackers:

http://core.tcl.tk/tcllib/reportlist

also please report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. we eat ideas for breakfast. πŸ“

when you propose code changes, please provide unified diffs, i.e the output of diff -u. no freestyling.

note further that attachments are strongly preferred over inlined patches. πŸ’…

attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. iykyk.


✨ SEE ALSO ✨

  • nameserv(n)

✨ KEYWORDS ✨

automatic, client, name service, reconnect, restore 🌸


✨ CATEGORY ✨

Networking


Copyright (c) 2007-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net>


and that's the whole page, bestie πŸ₯° this came from tcllib, version 0.4, of nameserv::auto(n) β€” go forth, keep your bound names safe, and remember: if the connection drops, she's already on it. mwah πŸ’–

πŸ“¦ where this page comes from