Tips on TCP socket to postgresql middleware

Chris Piker chris at hoopjump.com
Sun Feb 20 16:55:44 UTC 2022


On Sunday, 20 February 2022 at 15:20:17 UTC, eugene wrote:
> Most people will probably say this is crazy,
> but as to PG, one can do without libraries.
>
> I am doing so during years (in C, not D) and
> did not expierienced extremely complex troubles.
> I mean I do not use libpq  - instead I implement some
> subset of the protocol, which is needed for particular program.

Very interesting.  I need to stand-up this program and two others 
in one week, so it looks like dpq2 and message passing is the 
good short term solution to reduce implementation effort.  But I 
would like to return to your idea in a couple months so that I 
can try a fiber based implementation instead.

> Usually I design more or less complex (network) programs using
> event-driven paradigm (reactor pattern) plus state machines.
> In other words programs designed this way are, so to say,
> hierarchical team of state machines, interacting with
> each other as well as with outer world (signals,
> timers, events from sockets etc)

It sounds like you might have a rigorous way of defining and 
keeping track of your state machines.  I could probably learn 
quite a bit from reading your source code, or the source for 
similarly implemented programs.  Are there examples you would 
recommend?





More information about the Digitalmars-d-learn mailing list