<commit_before># pg_settimeout
POC for an adaption of the setTimeout(fnc* , timeout) function of javascript.


It basically takes an SQL statement of any kind and relays the task to a backgroundworker.
Usefull for some implementations that would otherwise require an application-level mechanism.

Currently misses many things, e.G. a proper overview of the running processes or following the 
executing process to a database (it's currently hardcoded to postgres).

## Example Usage:
create extension pg_settimeout;


    create table loghere(id serial primary key, pid int, status text);


    CREATE OR REPLACE FUNCTION nonstop() RETURNS integer AS $function$
         BEGIN
                insert into loghere(pid, status) values ( (select pg_settimeout($$
                UPDATE loghere SET status = 'DONE' WHERE pid=pg_backend_pid() ;      
                $$,10)), 'planned');
                
                PERFORM pg_settimeout(' select nonstop() ', 5);
                RETURN 1;
        END;
    $function$ LANGUAGE plpgsql;


    SELECT nonstop()



Now observe the loghere Table.<commit_msg>fixes in readme<commit_after># pg_settimeout
POC for an adaption of the setTimeout(fnc* , timeout) function of javascript.


It basically takes an SQL statement of any kind and relays the task to a backgroundworker.
Usefull for some implementations that would otherwise require an application-level mechanism.

Currently misses many things, e.G. a proper overview of the running processes or following the 
executing process to a database (it's currently hardcoded to postgres).

## Example Usage:


    create extension pg_settimeout;

    create table loghere(id serial primary key, pid int, status text);

    CREATE OR REPLACE FUNCTION nonstop() RETURNS integer AS $function$
         BEGIN
                insert into loghere(pid, status) values ( (select pg_settimeout($$
                UPDATE loghere SET status = 'DONE' WHERE pid=pg_backend_pid() ;      
                $$,10)), 'planned');
                
                PERFORM pg_settimeout(' select nonstop() ', 5);
                RETURN 1;
        END;
    $function$ LANGUAGE plpgsql;


    SELECT nonstop();


Now observe the loghere Table.
{'fraction_non_alphanumeric': 0.06639566395663957, 'fraction_numerical': 0.0036133694670280035, 'mean_word_length': 2.8189655172413794, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '33031', 'n_tokens_mistral': 618, 'n_tokens_neox': 554, 'n_words': 249}