Deutsch   English   Français   Italiano  
<v6ij7k$195lj$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.lang.python
Subject: Re: Best (simplest) way to share data (Posting On Python-List
 Prohibited)
Date: Tue, 9 Jul 2024 05:52:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <v6ij7k$195lj$2@dont-email.me>
References: <9a8nlk-jb81.ln1@q957.zbmc.eu> <v6crrk$1kfb$6@dont-email.me>
	<294tlk-pqr1.ln1@q957.zbmc.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 09 Jul 2024 07:52:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="04bb535b0c0a3ec0d50e843b1924189b";
	logging-data="1349299"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18Z43zefxdK//DPB2mdUk9v"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:w4HEnXpar1RDQWP7FqfgNpWMp5c=
Bytes: 1913

On Mon, 8 Jul 2024 13:56:34 +0100, Chris Green wrote:

> Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>>
>> If it’s a snapshot of current values, that does not persist when the
>> collector process is not running, then why not just keep the data in
>> the memory of the collector process, and have it concurrently listen on
>> a socket for connections from readers requesting a copy of the current
>> data?
> 
> That's exactly the sort of solution I was wondering about.  Is there a
> ready made module/library for handling this sort of thing?  Basically it
> will just be a string of a few tens of characters that would be kept up
> to date by one process and asked for by all the others.

You probably don’t need to define any nontrivial kind of protocol at all. 
Just accept a connection from a client, send it the current data in some 
convenient format (e.g. JSON), and disconnect.