Panel server for multiple users

One option is give to the user a lighweight page and actualize the page from a thread.

import panel as pn 
import holoviews as hv
import threading, time

def thread_function(col):
    time.sleep(5) # simulate the processing for 5 seconds 
    col[0] = pn.pane.Str('This is a raw string which will not be formatted in any way except for the applied style.', style={'font-size': '12pt'})

def get_page_user():

    loading = pn.indicators.LoadingSpinner(value=True, width=100, height=100)

    col = pn.Column(loading)

    t = threading.Thread(target=thread_function, args=(col,))
    t.daemon = True
    t.start() 

    return col

pn.serve(get_page_user, port=5000, show=False)

I hope this helps, I could not watch your code due to lot of end of the year deadlines-

1 Like