Re: Composing tasks and protected objects
- From: Jeffrey Carter <spam@xxxxxxxx>
- Date: Sat, 06 Aug 2005 05:52:11 GMT
Florian Weimer wrote:
Suppose I want to write a selective accept which reads messages from a queue, and also support a special entry call to reload the configuration.
You need all calls to go the same way. Right now you're trying to do something like
+----------+ +----------+ +----------+ | | | | | | | Q |<--Get----| Server |<--Shut---| ? | | | | | Down | | | | | |<--Reload-| | | | | | | | +----------+ +----------+ +----------+
where arrows indicate direction of call. This won't work, but it will work if you can turn that call to Get around. For this, you need a forwarder between the Queue and Server:
+----------+ +----------+ +----------+ +----------+ | | | | | | | | | Q |<-Get--| Forwarder|--Msg->| Server |<-Etc--| ? | | | | | | | | | +----------+ +----------+ +----------+ +----------+
Now your task can look like
select
accept Msg (Message : in ...) do
Current_Message := Message;
end Msg;Process_Message (Current_Message); or ... -- as in your example end select;
The only difficulty is terminating the Forwarder.
-- Jeff Carter "Go and boil your bottoms." Monty Python & the Holy Grail 01 .
- Follow-Ups:
- Re: Composing tasks and protected objects
- From: Florian Weimer
- Re: Composing tasks and protected objects
- References:
- Composing tasks and protected objects
- From: Florian Weimer
- Composing tasks and protected objects
- Prev by Date: Re: Newbie: Code isn't executed
- Next by Date: Re: Composing tasks and protected objects
- Previous by thread: Re: Composing tasks and protected objects
- Next by thread: Re: Composing tasks and protected objects
- Index(es):
Relevant Pages
|
|