mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
This simple query allows you to ditch rolling your own state machine for handling async pgsql states and instead asks you to provide 3 functions: - init - results - done You can see the different in complexity in the pgsql example, which now contains a pgsql_simple.c holding the same asynchronous query as in pgsql.c but using the simple pgsql api. You can of course still roll your own in case you want more control.
Kore pgsql example.
This example demonstrates how one can use Kore state machines and the pgsql api to make fully asynchronous SQL queries.
Asynchronous in this case meaning, without interrupting a Kore worker its other clients their I/O or http requests.
Tons of comments inside on how everything works.
Run:
# kore run