-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
104 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"viz_server", | ||
"analysis_server", | ||
"qoi_server", | ||
"tomo_server", | ||
] | ||
|
||
entry_points = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import fire | ||
from bluesky.utils import install_qt_kicker | ||
from xpdan.vend.callbacks.core import RunRouter | ||
from xpdan.vend.callbacks.zmq import RemoteDispatcher | ||
from xpdconf.conf import glbl_dict | ||
from databroker_elasticsearch import callback_from_name | ||
|
||
|
||
def run_server( | ||
prefix=None, | ||
outbound_proxy_address=glbl_dict["outbound_proxy_address"], | ||
server_name="xpd", | ||
): | ||
"""Start up the visualization server | ||
Parameters | ||
---------- | ||
prefix : bytes or list of bytes, optional | ||
The Publisher channels to listen to. Defaults to | ||
``[b"an", b"raw"]`` | ||
outbound_proxy_address : str, optional | ||
The address and port of the zmq proxy. Defaults to | ||
``glbl_dict["outbound_proxy_address"]`` | ||
server_name : str | ||
The name of the elasticsearch server, this is used with | ||
``databroker_elasticsearch.callback_from_name`` to produce the | ||
elasticsearch callback | ||
""" | ||
# TODO: allow handing in of callbacks (for direct python use) | ||
d = RemoteDispatcher(outbound_proxy_address, prefix=prefix) | ||
install_qt_kicker(loop=d.loop) | ||
|
||
d.subscribe(callback_from_name(server_name)) | ||
print("Starting Elastic Search Server") | ||
d.start() | ||
|
||
|
||
def run_main(): | ||
fire.Fire(run_server) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.