Skip to content

Feature request: execute function on client connection state changed #52

@W1M0R

Description

@W1M0R

It would be useful to be able to specify an SQL function for postgres-websockets, that will be executed when a WebSocket client connects or disconnects. The function will receive the client identity, perhaps the connecting JWT or some other connection-related properties such as IP, etc. The function will also receive the state of the connection (perhaps based on https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), e.g. CONNECTING, OPEN, CLOSING, CLOSED.

Users of the function could use it to schedule or stop cron jobs, or do database cleanup or setup tasks, or to run pg_notify tasks etc.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions