Re: Asynchronous Communication across two independent

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: damien(dot)dougan(at)mobilecohesion(dot)com
Subject: Re: Asynchronous Communication across two independent
Date: 2003-03-25 13:41:40
Message-ID: 3E805C93.2122D26C@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Just out of curiosity. It may look like a bit of a hack, but as long as
it is
clearly documented, it seems doable:
>
> > How about sharing connections between sender and receiver. After all

> > PGConnection is only pointer that can be same for Sender and
Receiver.

Yes, share connection by a common PGconn data set, write/read via a
binary file
or whatever interprocess data exchange you prefer.

> > How do you mean to connect Sender and Receiver ? How should postgres
know
> > which Sender will post results to which Receiver ?

That's not the point as I understand it. There is one sender using
PQsendQuery,
and one receiver using PQgetResult. So postgres does not even need to
know
there are two processes working as sender resp. receiver.

>
> Our architecture is message based, so I can't delay the Sender waiting
for
> incoming messages (buffering them together) into a single PQsendQuery
because
> its all asynchronous communication.
>
Really? Before making a call to PQsendQuery you have to make sure the
previous
results have been completely processed by PQgetResult. So you need some
kind of
interprocess communication facility anyway to tell the sender when
another
PQsendQuery is possible. And as long as there is no ok from the
receiver, the
sender has to accumulate the queries.

Does this sound plausible or did I get something completely wrong?

Regards, Christoph

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Christoph Haller 2003-03-25 14:00:50 Re: Interaction between Cursor and Transaction storage?
Previous Message Darko Prenosil 2003-03-25 13:13:25 Re: Asynchronous Communication across two independent components