[comp.sys.amiga.tech] 2.0 commodities

davewt@NCoast.ORG (David Wright) (09/15/90)

	I am about to start on a new project, and I want to try and make use
of the new 2.0 features. Basically the project is as follows:

	A central "server" which looks for messages of a certain type,
and sends an appropriate message to a list of clients who wish to be notified
of certain events.

This is going to be a utility which will let people shut down their system
in an orderly fashion, when a signal is received from their UPS (uninteruptable
power system (since if you didn't have one and you lost power, not much would
help you :-)). The reason that I don't want to make just one program to
talk to the UPS and the list of clients is that there are many kinds of
UPS systems, which have different ways of notifying the system that utility
power has been lost. And it would also be nice if an Amiga on a network could
be shut down properly, when it is not actually attached to the UPS.

So what I want to do is make one server that will both take power out and
power restored type messages from one kind of client, and send the appropriate
message to the other clients. And it would also be nice if the server could
restart applications itself when power came back on.

My main question has to do with 2.0 "commodities". Looking at the
commodities.h file it appears it already has a message type "kill", which
I could use (and people could then also use the CEX to stop applications),
and it appears you can make commodities that SEND messages, and other
commodities that only want to RECEIVE messages.

So, can the system commodity exchange itself work as the server (leaving out
the autostart up feature, of course), or would it be more worthwhile to
just use the normal message passing system (or even ARexx) to do the same
thing? I like the idea of people being able to pull up CEX and see which
programs are running, and kill them that way, much better that having to
use ^C or ^F from the CLI (and hoping the program looks for it).

Are there any books out yet on programming with the new features of 2.0?


			Dave