Uncategorized

javascript – Python Flask Socket as Listener for Database Changes


I want to make a Websocket that sends a message to the connected clients when something changes in a specific table in the database. I already have the functions for changing items in the db and want to call a function that notifies the clients.

def addXtoDB(...):
    # code to add...
    notifyClients();

def editXtoDB(...):
    # code to edit...
    notifyClients();


def notifyClients();
    # ??

And how can I access that in Javascript/Typescript?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *