I need that immediately after clicking the button, the button is turned off in order to exclude the repeated pressing of the button and inform about the start of the process of querying the database. After that, a query to the database is performed, about 5 minutes. After receiving the data, the button turns on again.
In my application my_app.py, the button is turned off and on only after processing the on_button_clicked () callback, I need the document to be updated immediately after the user clicks the button, without waiting for the database to process the request. How to implement this?
from bokeh.io import curdoc
from bokeh.models.widgets import TextAreaInput,Button
from bokeh.layouts import column
button = Button(label=“Download information from DB”, button_type=“success”)
information = TextAreaInput(value=’’, rows=6, title=“Information from DB:”)
button.disabled=True #I turn off the button so that the user does not click again and sees that the database request has been sent
time.sleep(2)#imitation of very long database query processing
button.disabled=False#information received from the database