LucyX:...hServer(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

LucyX::Remote::SearchServer β€” making a Searcher remotely accessible, bestie. That's it, that's the whole job. ✨


🌸 SYNOPSIS 🌸

okay so literally this is the entire vibe:

my $searcher = Lucy::Search::IndexSearcher->new(
    index => '/path/to/index'
);
my $search_server = LucyX::Remote::SearchServer->new(
    searcher => $searcher
);
$search_server->serve(
    port => 7890
);

like. build a searcher, wrap it, serve it. three steps, no cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the SearchServer class, when it links up with either SearchClient or ClusterSearcher, makes it possible to run a search on one machine and report the results on another. yes really. it's giving long-distance relationship but make it distributed systems. πŸ˜­πŸ’–

and here's the iconic part: by aggregating several SearchClients under a ClusterSearcher, the cost of searching what might have been a prohibitively large monolithic index can be distributed across multiple nodes, each one with its own, smaller index. main character energy for your infrastructure, fr fr. πŸ‘‘


πŸŽ€ METHODS πŸŽ€

🌈 new

my $search_server = LucyX::Remote::SearchServer->new(
    searcher => $searcher, # required
);

Constructor, babes. takes hash-style parameters, so you pass in keys and values like it's nothing.

  • searcher β€” the Searcher that the SearchServer will wrap. it's literally the whole point. 🫢

✨ serve

$search_server->serve(
    port => 7890,      # required
);

open a listening socket on localhost and wait for SearchClients to connect. like sitting by the phone waiting for your bestie to text back. πŸ’€πŸ“±

  • port β€” the port on localhost that the server should open and listen on.

πŸ’… serve_rpc

my $status = $search_server->serve_rpc($sock);

handle a single RPC from socket $sock. one. singular. don't get it twisted. πŸ™ˆ

here's the vibe check on what it hands back to you:

  • returns 'done' if the connection should be closed.
  • returns 'terminate' if the server should shut down. 😭
  • returns 'continue' if the server should continue to handle requests from this client. slay, we're staying. ✨

okay that's the whole page, you ate that reading it πŸ’– this was the User Contributed Perl Documentation, perl v5.42.0, dated 2025-07-25 β€” writing that down at the bottom like a little yearbook signature, byeeeee πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from