comp.lang.ada
 help / color / mirror / Atom feed
From: Hadrien Grasland <hadrien.grasland@gmail.com>
Subject: Re: Asynchronous channels in Ada
Date: Wed, 24 Feb 2016 23:55:37 -0800 (PST)
Date: 2016-02-24T23:55:37-08:00	[thread overview]
Message-ID: <0d8b37aa-a29d-4be6-a4e0-66eea06c4858@googlegroups.com> (raw)
In-Reply-To: <dd09d409-78ef-4cf5-9557-e38b7042e3ab@googlegroups.com>

So, to summarize, what you would suggest is to mimick the layered architecture of network protocols, and separate the task of getting messages across from one task to another (which can be handled by any synchronized queue implementation), 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 depending on the discriminant's value
2. A tagged message interface that is associated to two concrete implementations, one which carries data and normally returns it upon "opening", and one which carries errors and throws exceptions in this situation.

That sounds like a very good idea, I'll experiment with it some more. Thanks !


  parent reply	other threads:[~2016-02-25  7:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 21:02 Asynchronous channels in Ada Hadrien Grasland
2016-02-19 21:45 ` Simon Wright
2016-02-19 23:31   ` Robert A Duff
2016-02-19 21:51 ` Jeffrey R. Carter
2016-02-19 23:53   ` Brad Moore
2016-02-20  9:54 ` Dmitry A. Kazakov
2016-02-21 22:57 ` Hadrien Grasland
2016-02-22  2:30   ` Jeffrey R. Carter
2016-02-22  8:48   ` Dmitry A. Kazakov
2016-02-22  9:28   ` Georg Bauhaus
2016-02-25  7:55 ` Hadrien Grasland [this message]
2016-03-24  2:37 ` rieachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox