Calling 'bokeh serve' from within program

I currently have a program that runs something like:

subprocess.Popen(‘bokeh serve %s --host %s --port %d’ % (‘myApp.py’,‘1.2.3.4’,9999) )

except it allows user inputs for app name, port number, and host.

What I’d like to be able to do is run the server by calling:

from bokeh.command.subcommands import serve

serve(some_args)

Is this a possibility?

I’m pretty sure
you’ll always need a sepa rate
process.

···

On 8/8/16 9:57 AM, wrote:

[email protected]

    I currently have a program that runs something

like:

        subprocess.Popen('bokeh serve %s --host %s --port %d'

% (‘myApp.py’,‘1.2.3.4’,9999) )

          except it allows user inputs for app name, port number,

and host.

          What I'd like to be able to do is run the server by

calling:

from bokeh.command.subcommands import serve

serve(some_args)

Is this a possibility?

  You received this message because you are subscribed to the Google

Groups “Bokeh Discussion - Public” group.

  To unsubscribe from this group and stop receiving emails from it,

send an email to [email protected].

  To post to this group, send email to [email protected]

  To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/bf2015c6-e9e2-4092-9694-aa3a256b80d4%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/bf2015c6-e9e2-4092-9694-aa3a256b80d4%40continuum.io?utm_medium=email&utm_source=footer).

  For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).


Sarah Bird
Developer, Bokeh

    [
      ![Continuum Analytics](http://docs.continuum.io/_static/img/ContinuumWordmark.png)
    ](http://continuum.io)

It might also be possible to start a server in a separate thread. The key thing to note is the Bokeh server is a tornado app, so ultimately it requires an IOLoop to use. It's also potentially the case that if you are already in a Tornado app, that you can pass an existing IOLoop to the Bokeh server code to use (instead of creating a dedicated new one, as it normally does). However, I have never had the opportunity to conduct this experiment.

Thanks,

Bryan

···

On Aug 8, 2016, at 12:01 PM, Sarah Bird - Continuum <[email protected]> wrote:

I'm pretty sure you'll always need a separate process.

On 8/8/16 9:57 AM, [email protected] wrote:

I currently have a program that runs something like:

    subprocess.Popen('bokeh serve %s --host %s --port %d' % ('myApp.py','1.2.3.4',9999) )

except it allows user inputs for app name, port number, and host.
What I'd like to be able to do is run the server by calling:
    
    from bokeh.command.subcommands import serve
    serve(some_args)

Is this a possibility?
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bf2015c6-e9e2-4092-9694-aa3a256b80d4%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
Sarah Bird
Developer, Bokeh

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/43aebbe8-a198-1dc5-6ca9-8f1e06a3ed44%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/LYmjTXzX43E
check it out

···

On Monday, August 8, 2016 at 2:20:31 PM UTC-5, Bryan Van de ven wrote:

It might also be possible to start a server in a separate thread. The key thing to note is the Bokeh server is a tornado app, so ultimately it requires an IOLoop to use. It’s also potentially the case that if you are already in a Tornado app, that you can pass an existing IOLoop to the Bokeh server code to use (instead of creating a dedicated new one, as it normally does). However, I have never had the opportunity to conduct this experiment.

Thanks,

Bryan

On Aug 8, 2016, at 12:01 PM, Sarah Bird - Continuum [email protected] wrote:

I’m pretty sure you’ll always need a separate process.

On 8/8/16 9:57 AM, [email protected] wrote:

I currently have a program that runs something like:

subprocess.Popen('bokeh serve %s --host %s --port %d'  % ('myApp.py','1.2.3.4',9999) )

except it allows user inputs for app name, port number, and host.

What I’d like to be able to do is run the server by calling:

from bokeh.command.subcommands import serve
serve(some_args)

Is this a possibility?

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/bf2015c6-e9e2-4092-9694-aa3a256b80d4%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


Sarah Bird

Developer, Bokeh


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/43aebbe8-a198-1dc5-6ca9-8f1e06a3ed44%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.