TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: PANCHO
from: MARTIN GREGORIE
date: 2021-01-17 14:32:00
subject: Re: Battery Powered Proje

On Sun, 17 Jan 2021 10:39:32 +0000, Pancho wrote:

> However, I'm not yet convinced this is a sensible way of observing
> events. I'm still undecided.
>
That depends: if the occurrence of events to be observed cause messages
to be logged rather than being dealt with by the program that observes
them, then watching a log for the occurrence might well be the best way
to do it since this separates the observation from the consequent action,
offering the possibility of more than one observing process being able to
trigger the action. Where that action is irreversable, as it is in this
case, that sounds like a good idea.

Of course, if the observer doesn't log anything, there's no reason to use
a general purpose logfile - just write the observations to a file or
pipeline that's accessable to the process that will execute the action:
as this is Linux, you can use shared memory or a semaphore (if the
programming language supports it) to signal that an actionable event has
occurred. Shared memory, event queues and asynchronous i/o are all
available in the C and Java standard function/class libraries but may not
be in other languages.

OTOH if the required action is specific to the observer, i.e. doesn't
affect anything outside the process(es) handling the data stream being
observed, then simply deal with the observation inside the observing
process.


--
--
Martin    | martin at
Gregorie  | gregorie dot org

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.