Add wildcard peer listing and shell completion to the libby CLI - #38
Conversation
| def rpc(self, peer_id: str, key: str, payload: Dict[str, Any], ttl_ms: int = 8000): | ||
| return self.request(peer_id, key, payload, ttl_ms) | ||
|
|
||
| def broadcast_request( |
There was a problem hiding this comment.
With this change, I think we need to re-think a bit about "who" is replying back. Before with keys.list we are under the assumption that everyone is a daemon (and libby client is another daemon). I'm thinking when a Libby object is created, it now says whether it's is_daemon=True or not. Only LibbyDaemon instances sets that tag to True; regular Client connections default to False. When peer_listings() collects the broadcast replies, it now only keeps the ones where is_daemon=True.
|
Confirmed: a plain Added |
libby list hsfei.%lists the live daemons in a group;libby list %.%.isconnectedreads one keyword across the fleet. A%in the group or daemon segment is answered by broadcastLibby.broadcast_requestcollects replies to a destination-less REQ, which bamboo sends but never waits forClient.peersandClient.peer_listingsexpose the same broadcast programmatically;Client.listroutes to it when the pattern spans daemonsLibbyserveskeys.list, soLibbyDaemonbuilds itsLibbywithis_daemon=Trueand a reply counts only if it reports thatlibby completion bash|zshprints shell code for TAB completion of verbs, flags and addresses, with candidates from the same broadcast, a 0.5s bound and a 10s cache in~/.libby/completion_cache.json. Adds anargcompletedependencypeers_aliveis always empty sinceProtocolnever instantiates aPeerTable, ZMQ's hello only reaches peers already in the address book, andLibby.rabbitmqnever starts hello