In that answer, "bokeh_serve" is the an object that represents (and started) the Bokeh server programmatically.
Are you starting the Bokeh server on the command line by hand? Or are you starting it programmatically?
It might easier to just embed the bokeh server as a library if you want this kind of control:
But I couldn't really understand where / how to use "self.bokeh_serve.kill()" or "self.bokeh_serve.terminate()".
Also, I couldn't understand what would be my command variable at this line of code:
self.bokeh_serve = subprocess.Popen(shlex.split(command), shell=False, stdout=subprocess.PIPE)
I'd really appreciate any help or explanations on this.