From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.140.39.229 with SMTP id v92mr12611196qgv.25.1456386937884; Wed, 24 Feb 2016 23:55:37 -0800 (PST) X-Received: by 10.182.246.231 with SMTP id xz7mr203632obc.5.1456386937843; Wed, 24 Feb 2016 23:55:37 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!w104no3373357qge.1!news-out.google.com!k1ni396igd.0!nntp.google.com!ok5no4715906igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Feb 2016 23:55:37 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=128.141.38.249; posting-account=21X1fwoAAABfSGdxRzzAXr3Ux_KE3tHr NNTP-Posting-Host: 128.141.38.249 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0d8b37aa-a29d-4be6-a4e0-66eea06c4858@googlegroups.com> Subject: Re: Asynchronous channels in Ada From: Hadrien Grasland Injection-Date: Thu, 25 Feb 2016 07:55:37 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29601 Date: 2016-02-24T23:55:37-08:00 List-Id: So, to summarize, what you would suggest is to mimick the layered architect= ure of network protocols, and separate the task of getting messages across = from one task to another (which can be handled by any synchronized queue im= plementation), from that of transmitting either valid data or errors inside= of messages. You would then handle the latter task by using either... 1. Discriminated records that can contain either messages or errors dependi= ng on the discriminant's value 2. A tagged message interface that is associated to two concrete implementa= tions, one which carries data and normally returns it upon "opening", and o= ne which carries errors and throws exceptions in this situation. That sounds like a very good idea, I'll experiment with it some more. Thank= s !