Tips on TCP socket to postgresql middleware

eugene dee0xeed at gmail.com
Sun Feb 20 18:00:26 UTC 2022


On Sunday, 20 February 2022 at 16:55:44 UTC, Chris Piker wrote:
> But I would like to return to your idea in a couple months so 
> that I can try a fiber based implementation instead.

I thougt about implementing my engine using fibers but...
it seemed to me they are not very convinient because
coroutines yield returns to the caller, but I want
to return to a single event loop (after processing an event).

>> 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?

Yes, here is my engine with example (echo client/server pair):

- [In C (for 
Linux)](http://zed.karelia.ru/mmedia/bin/edsm-g2-rev-h.tar.gz)
- [In D (for Linux & 
FreeBSD)](http://zed.karelia.ru/0/e/edsm-2022-02-20.tar.gz)

edsm = 'event driven state machines'

As to the program you are writing - I wrote a couple of dozens of 
programs
more or less similar to what you are going to do (data 
acqusition) using the engine above (C) for production systems and 
they all serve very well.





More information about the Digitalmars-d-learn mailing list