Hi Holger,
On Mon, Jul 18, 2011 at 07:01:18PM +0200, Holger Hans Peter Freyther wrote:
I wonder what is the easiest way to make our database code async. Looking at our tables and code we do not seem to have a very complicated use.
I agree with your analysis in all points.
I would probably look at the SMS issue independently, as we always wanted to get the SMS code out of the main program and into a separate process. If we do this, that process can do whatever it does. The main program simply behaves like a GW-MSC talking to an SMSC.
biggest problem: What do we do with the DB queries done from VTY that are asynchronous, e.g to confirm a SMS has been stored? Do we care about it? Do we turn this to a 'notification'?
One option would be to simply 'not do it', i.e. remove those features form the vty and have a different/external program that can query the database independently.
If we still want to show everything under one command like, we might add some kind of 'pass through' where we pass certain commands out (via a socket) to an external program. That program then can have blocking semantics or whatever it wants.
A more radical approach would be to have a per-telnet-vty thread. As there are only few concurrent (typically 1) vty sessions active, we wouldn't have to worry about the number of threads here.
Regards, Harald